Shoutbox

Text in Unicode - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Forum: Plug-Ins (/forumdisplay.php?fid=28)
+------ Thread: Text in Unicode (/showthread.php?tid=51482)

Text in Unicode by eSouL on 10-07-2005 at 07:33 AM

How do I program a plugin to send and receive Unicode text? Currently, all unicode characters are shown as question marks. Thanks!


RE: Text in Unicode by J-Thread on 10-07-2005 at 08:10 AM

I don't think that is possible... Although msn should know Unicode, but I doubt if it is possible for plugins to use it.

It are all just ASCII strings as fas as I know...


RE: Text in Unicode by eSouL on 10-07-2005 at 08:26 AM

My sContactName values are all messed up because of Unicode in their names.. Are there any workarounds?


RE: Text in Unicode by CookieRevised on 10-07-2005 at 11:54 AM

For starters, about what programming language are you talking about? Second, every programming language is capable of receiving and sending unicode text.

In other words, there is no need for workarounds. You only need to do it correctly ;)


RE: Text in Unicode by Mnjul on 10-07-2005 at 12:29 PM

Did you use the functions with the suffix W and exported them instead of the "normal" functions (those without the suffix W)? For example, use ReceiveNotifyW, ParseCommandW, ParseTagW...etc. Also, you are compiling/building your DLL with Unicode option enabled?( I know there is one in Visual Studio if that's what you are using) You have to set them all correctly so that Plus! will recognize your plugin as a Unicode-supporting one and will send Unicode text to your plugins (that is, for example, if you use ReceiveNotifyW, the sContactName will be of WCHAR type and it will of course be Unicode) ;)


RE: Text in Unicode by eSouL on 10-10-2005 at 02:27 AM

Hi, I'm using VB6. How do I make my plugin use the W functions? Do I just apped all the normal function names with a suffix W? Sorry I'm new to this. I also can't seem to find the option to compile to Unicode-aware. Thanks for your help!


RE: Text in Unicode by CookieRevised on 10-10-2005 at 08:54 AM

quote:
Originally posted by eSouL
Hi, I'm using VB6. How do I make my plugin use the W functions? Do I just apped all the normal function names with a suffix W?
That highly depends on what API's you use. Not all API's are available as unicode functions. To know if a specific API is available as unicode you need to look it up in the msdn library.

Furthermore, the unicode equivalents require you to parse text in a different manner. This is because VB6 always converts unicode strings to ansi strings before they are send to these API's (unicode or not). Thus in order to send unicode text you need to parse them as pointers. Or you must convert the unicode strings first to unicode (this may sound strange, but it simply means fooling VB6).

Take a look at my posts about sending a PSM to MSN Messenger, they deal with unicode and the common errors people have with them: http://forums.msnfanatic.com/index.php?showtopic=11226

quote:
Originally posted by eSouL
I also can't seem to find the option to compile to Unicode-aware. Thanks for your help!
VB6 is always unicode internally. You don't need to set anything.



But note that VB6 does not support unicode externaly, this means it will always show ansi strings in its controls. Getting around that is far from easy (unless you use the not-distributable Forms2.0 library, as this contains unicode aware controls)...


All in all it is very difficult to explain everything as there is much to know about all this.

http://www.oreilly.com/catalog/win32api/chapter/ch06.html
^^ this is mandatory to understand completely and in detail before you start working with unicode in VB6

another link which deals with some stuff:
http://support.microsoft.com/default.aspx?scid=kb;en-us;205277
RE: Text in Unicode by eSouL on 10-10-2005 at 03:34 PM

Thanks for the reply Cookies! I discovered that the VC++ sample header file includes declarations of the W functions, and I thought it would be relatively to port over to VB6. I'll see what can be done..


RE: Text in Unicode by CookieRevised on 10-10-2005 at 10:34 PM

Yes, many (but certainly not all!) API's have both an unicode version (reconizeable by the "W" endfix) and an ansi version (reconizeable by the "A" endfix). To know exactly if such variations exist for a specific function (and if they actually work on the OS you're planning to run your app on!!!!), you can look them up in the [http://www.msdn.com/]MSDN Library[/url]. It will also tell you every detail about that API function...

And also, certainly do not forget to read (and understand):
http://www.oreilly.com/catalog/win32api/chapter/ch06.html
:p;)