Page 1 of 1

Unicode data into Rev fields

Posted: Tue Apr 01, 2008 8:46 pm
by larryh
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

Posted: Wed Apr 02, 2008 12:40 am
by Mark
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

Posted: Thu Apr 03, 2008 6:32 pm
by larryh
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

Posted: Thu Apr 03, 2008 8:33 pm
by Janschenkel
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.