Unicode Problem
Dave
dave at looktowindward.com
Wed Jan 16 19:57:26 EST 2008
Hi,
I'm reading a string from a file that is stored in Unicode (2-byte)
format. I need to convert it to one byte characters in order to write
the string to a database which is later sent to the server.
When I execute the following it gives unexpected results
put uniDecode(myStringData,"ANSI") into myStringData
For instance, before executing the above, myStringData contained the
following (in Decimal):
84 0 104 0 101 0 32 0 65 0 108 0 103 0 101 0 98 0 114 0 97 0 105 0
115 0 116 0
afterwards it contains:
0 0 0 0 0 0 0 0 0 0 0 0 0 0
I also tried uniDecode(myStringData) (leaving the second parameter
empty) which results in the same string being returned as was input,
e.g. in this case:
84 0 104 0 101 0 32 0 65 0 108 0 103 0 101 0 98 0 114 0 97 0 105 0
115 0 116 0
My question is, how can I convert a 2 byte string into a 1 byte string?
Thanks a lot
All the Best
Dave
More information about the use-livecode
mailing list