What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Unicode string to hex not working

Unicode string to hex not working
Author: Message:
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
32 / Male / Flag
Joined: Apr 2004
RE: Unicode string to hex not working
In that case, I think you should just drop the String.fromCharCode(). It'll convert your number into a character, and since you want numbers you just have to leave them out, no?

But if you want the high-order byte first, you'll need to swap the two around, because at the moment the low-order is first.
code:
function SetDataPatch(sUnicodeString) {
    var newstring = "";
    for (var i = 0; i < sUnicodeString.length; i++) {
        var charCode = sUnicodeString.charCodeAt( i );
        newstring += charCode >>> 8; //High-order
        newstring += charCode & 0xFF; //Low-order
    }
    return newstring;
}
But this functions will only join the decimal numbers together... Do you want spaces between the numbers? Do you want the numbers to be hexadecimal? You really should give us a clear explanation of what your function has to do.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
08-14-2007 03:33 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Unicode string to hex not working - by GNSPS on 08-14-2007 at 01:08 AM
RE: Unicode string to hex not working - by Adeptus on 08-14-2007 at 02:03 AM
RE: Unicode string to hex not working - by GNSPS on 08-14-2007 at 02:55 AM
RE: Unicode string to hex not working - by Adeptus on 08-14-2007 at 03:34 AM
RE: Unicode string to hex not working - by GNSPS on 08-14-2007 at 11:59 AM
RE: Unicode string to hex not working - by Matti on 08-14-2007 at 12:40 PM
RE: Unicode string to hex not working - by GNSPS on 08-14-2007 at 01:09 PM
RE: Unicode string to hex not working - by Matti on 08-14-2007 at 03:33 PM
RE: Unicode string to hex not working - by GNSPS on 08-14-2007 at 08:14 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On