What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Hex Help

Hex Help
Author: Message:
phalanxii
Full Member
***


Posts: 146
Reputation: 5
32 / Male / Flag
Joined: Aug 2006
Status: Away
RE: Hex Help
I think he wants a function which takes a string like
code:
var string = "ÿü"
and turns it into
code:
var newstring = "\xFF\x00\xFC"
or by the looks of his code
code:
var newstring = "\xFF\x00\xFC\x00"
In other words, he wants to take each character in the string, turn them into the hex unicode notation ("\x__"), insert "\x00" between each character and return the whole thing as a string. For example, SetDataPatch("abc") will return "\x61\x62\x62".

As far as I know, a function like this is completely useless because "a" === "\x61" (someone correct me on this one ^o)). However, if the function is to give "\\xFF\\x00\\xFC\\x00" (which will display as "\xFF\x00\xFC\x00" to the user), you can use this:
code:
function SetDataPatch(string) {
   var newstring = "";
   for(var i = 0; i < string.length; i++) {
      newstring += "\\x" + string.charCodeAt(i).toString(16) + "\\x00";
   }
   Debug.Trace(newstring);
   return newstring;
}

This post was edited on 01-17-2007 at 04:20 AM by phalanxii.
01-17-2007 04:15 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Hex Help - by TheGuruSupremacy on 01-16-2007 at 04:20 PM
RE: Hex Help - by Matti on 01-16-2007 at 05:04 PM
RE: RE: Hex Help - by TheGuruSupremacy on 01-16-2007 at 05:16 PM
RE: Hex Help - by Plik on 01-16-2007 at 07:28 PM
RE: Hex Help - by phalanxii on 01-17-2007 at 04:15 AM
RE: RE: Hex Help - by CookieRevised on 01-17-2007 at 05:13 AM
RE: RE: RE: Hex Help - by TheGuruSupremacy on 01-17-2007 at 01:51 PM
RE: Hex Help - by TheGuruSupremacy on 01-17-2007 at 06:06 PM
RE: Hex Help - by CookieRevised on 01-17-2007 at 07:00 PM
RE: RE: Hex Help - by TheGuruSupremacy on 01-17-2007 at 07:16 PM
RE: Hex Help - by CookieRevised on 01-17-2007 at 08:29 PM
RE: RE: Hex Help - by TheGuruSupremacy on 01-17-2007 at 09:35 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