Article Preview
Buy Now
COLUMN
Ask The Experts
Issue: 2.2 (October/November 2003)
Author: Seth Willits with Thomas Reed
Article Description: No description available.
Article Length (in bytes): 8,299
Starting Page Number: 34
Article Number: 2215
Related Web Link(s):
http://www.domainsoftworx.com/downloads/DownloadSS.html
http://support.realsoftware.com/listmanager/
http://www.rbgarage.com/
http://www.resexcellence.com/
http://www.applelinks.com/rbu/
http://www.freaksw.com/rbgames/
http://www.monkeybreadsoftware.de/realbasic/plugins.html
Excerpt of article text...
Q: In my MySQL database I insert data into a column encoded as UTF-8, yet when I retrieve the data it comes back as ASCII. Why does it do this?
For simplicity's sake (and probably other reasons), MySQL doesn't respect string encoding. It doesn't matter if the text is put into a column as a UTF-8 or UTF-16 string; MySQL just knows it has a chunk of bytes to treat as a string and passes them along to REALbasic, which in turn just gives it a standard ASCII encoding since version 5 doesn't have the mind-reading feature we've been so desperately waiting for.
If you want to retrieve your data in a specific encoding, you'll have to retrieve the string and then define its encoding to that of your desire using the DefineEncoding method.
Function GetUTF8StringFromRecordColumn(rs as RecordSet, columnName as string) As string
...End of Excerpt. Please purchase the magazine to read the full article.