Hi,
I have a SQLite database with data encoded in UTF8. I can't seem to figure out a way to get the data to display in Rev fields properly. I have been using the Database Query Builder, and then populate fields using the Object Inspector ... Database properties. I have tried setting the Text Formatting on the field properties to a unicode font, with Unicode, with UTF8, etc. and I seem to either get ANSI characters or Chinese characters showing up. I can't get the special characters in the data to appear properly in the field.
Any suggestions? I have also tried reencoding the SQLite database as UTF16LE and the same problems occur.
Thanks,
Larry
Unicode data into Rev fields
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Larry,
this should work:
set the unicodeText of fld x to uniencode(myVar,UTF8)
MyVar is a variable containing the UTF8 string from your database.
Note that the endian of the unicode string needs to be the same as the endian of your processor. Intel: little endian, PPC: big endian.
If the endian is not right, you can switch the bytes in the variable by a repeat loop. Just put each second byte before its preceding byte. This shouldn't apply to UTF8, though.
Best,
Mark
this should work:
set the unicodeText of fld x to uniencode(myVar,UTF8)
MyVar is a variable containing the UTF8 string from your database.
Note that the endian of the unicode string needs to be the same as the endian of your processor. Intel: little endian, PPC: big endian.
If the endian is not right, you can switch the bytes in the variable by a repeat loop. Just put each second byte before its preceding byte. This shouldn't apply to UTF8, though.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Thanks Mark. Yes, this does work : )
I was hoping to be able to use the built-in database properties of the field that allow you to directly link to a Query built in the Database Query builder but it looks like I need to load the data from the query into variables, and then into fields.
Having lots of fun experimenting with Rev!
Larry
I was hoping to be able to use the built-in database properties of the field that allow you to directly link to a Query built in the Database Query builder but it looks like I need to load the data from the query into variables, and then into fields.
Having lots of fun experimenting with Rev!
Larry
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Contact:
You may want to add a feature request to the Quality Center, so they can add an enhancement to the Rev database library and automated query system.
http://www.quality.runrev.com
Jan Schenkel.
http://www.quality.runrev.com
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com