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:
GNSPS
Junior Member
**

Avatar
Coding is man's best friend...

Posts: 40
32 / Male / Flag
Joined: Oct 2006
O.P. Unicode string to hex not working
Why does this:

code:
function SetDataPatch(sUnicodeString) {
    var newstring = "";
    for (var i = 0; i < sUnicodeString.length; i++) {
        var charCode = sUnicodeString.charCodeAt( i );
        newstring += String.fromCharCode(charCode & 0xFF);
        newstring += String.fromCharCode(charCode >>> 8);
    }
    return newstring;
}


Always output the first letter of the unicode string??? Can't figure it out...

Edit: more debuging showed me that the bitwise AND is outputing the charcode itself and the right bit shift is outputing "0".

This post was edited on 08-14-2007 at 01:32 AM by GNSPS.
08-14-2007 01:08 AM
Profile E-Mail PM 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