Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
keithglong
- VIP Livecode Opensource Backer

- Posts: 348
- Joined: Sun Jul 03, 2011 2:04 am
Post
by keithglong » Sat May 21, 2016 12:28 am
Hi All,
I am trying to convert Hex to ASCII, similar to the
Hex to ASCII Text Converter at:
http://www.rapidtables.com/convert/numb ... -ascii.htm
When I enter
57612be9 and click on the "Convert" button, I get the following value:
Wa+é
Using the binaryEncode function in LiveCode...
Code: Select all
answer binaryEncode("H*", "57612be9")
I get
Wa+È
Any idea as to why that last character is off? Any feedback would be most welcome.
Thanks!
Sincerely,
Keith "Boo" Long
Gulf Breeze, Florida
-
Ledigimate
- Livecode Opensource Backer

- Posts: 132
- Joined: Mon Jan 14, 2013 3:37 pm
Post
by Ledigimate » Sat May 21, 2016 6:10 am
Hi Keith
The last 2 hex digits correspond to the 233rd character of the Extended ASCII Character set, which may vary on different platforms and computers for several reasons. The web calculator most likely uses a different Extended ASCII Character set from that used by LiveCode on your computer.
However, you can be fairly confident that the actual *binary* value would be the same across all platforms. The difference comes in when the binary value is converted to text.
Here's a Wikipedia article explaining how such differences can be commonplace:
https://en.wikipedia.org/wiki/Extended_ ... _confusion
Kind regards,
Gerrie
010100000110010101100001011000110110010100111101010011000110111101110110011001010010101101010100011100100111010101110100011010000010101101001010011101010111001101110100011010010110001101100101
-
keithglong
- VIP Livecode Opensource Backer

- Posts: 348
- Joined: Sun Jul 03, 2011 2:04 am
Post
by keithglong » Thu May 26, 2016 5:25 pm
Thanks guys!
However, you can be fairly confident that the actual *binary* value would be the same across all platforms.
Correct.
Warmest regards,
- Boo
Gulf Breeze, Florida