Urgent (desperate) cry for help...
Trevor DeVore
lists at mangomultimedia.com
Thu Jul 28 11:29:10 EDT 2005
On Jul 28, 2005, at 5:58 AM, Ton Kuypers wrote:
> I know I'm doing something wrong, there has to be a better way, but
> I just can't figure out what I'm doing wrong...
>
> Situation:
> - mySQL 4.1 running on a windows server
> - RR 2.6 OSX & Windows XP
> - Clients need to be Mac OS9, Mac OS-X and Windows XP
When working with most databases and using ASCII you need to decide
beforehand if you are going to store using the Mac or Windows
character encoding. I usually store as ISO (windows) and whenever
the code is running on the Mac I run all strings through ISOToMac()
when reading data and macToISO when inserting data. This way your
characters that have ASCII values greater than 127 will look right on
both platforms.
If you need unicode support then you can just encode/decode the
unicodeText of a fld to/from UTF16. When inserting into the database
you would use
uniDecode(unicodeText of fld "MyFld", "UTF8") --> CONVERTS FROM
UTF16 TO UTF8
and when getting data from the database you would use
set the unicodeText of fld "MyFld" to uniEncode(myDatabaseValue,
"UTF8") --> CONVERTS FROM UTF8 TO UTF16
--
Trevor DeVore
Blue Mango Multimedia
trevor at mangomultimedia.com
More information about the use-livecode
mailing list