Hi there!
I use SQLite to store the data (few columns, named Number, Name, Amplua etc).
And first problem is:
My LiveCode application don't "understand" the russian characters. Anyway:
1) If i put data by entering text in LiveCode and pass it to database, or
2) if i put data into database by SQLite Expert personal and read it from database by LiveCode application.
In both situations, russian characters (which readed from database) are displayed incorrect.
Second problem is:
I use casparCG to display animated titles (flash templates with dynamic text). When i try to assign text with russian charcters to dynamic text field, it's displayed incorrectly.
Both problems, i guess, because of troubles with coding
What am i do?
Encoding problems with SQLite
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Encoding problems with SQLite
Livecode 7 supports russian characters.
SQLite supports only ASCII characters.
Use base64Encode() and base64decode() functions before transfer to/from SQLite db.
SQLite supports only ASCII characters.
Use base64Encode() and base64decode() functions before transfer to/from SQLite db.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: Encoding problems with SQLite
Otherwise use the htmltext property of the fields. Probably the htmltext is faster, simpler and preserve font format.
Снег в вашей части? = <p><b>Снег в вашей части?</b></p>
Снег в вашей части? = <p><b>Снег в вашей части?</b></p>
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w
Re: Encoding problems with SQLite
By default, all data in SQLite is UTF8 encoded but you can also create a UTF16 encoded database if you need to. So yes, Russian characters can be handled as can any other unicode text.
Here's the code to do it, with thanks to Devin Assay.
If you have read your Russian text from the database into a variable named "tRussFldFromDB" and you want to display it in a field named "russStuff", the code is:
set the unicodeText of fld “russStuff” to uniencode(tRussFldFromDB,”utf8”) --for pre LC 7.0
put textDecode(tRussFldFromDB,”utf8”) into fld “russStuff” -- for LC 7.0+
To get Russian text from the field and put it into your database:
put unidecode(the unicodeText of fld “russStuff","utf8") into tRussTxt --for pre LC 7.0
put textEncode(the text of fld “russStuff”,”utf8”) into tRussTxt --for LC 7.0+
Pete
lcSQL Software
Here's the code to do it, with thanks to Devin Assay.
If you have read your Russian text from the database into a variable named "tRussFldFromDB" and you want to display it in a field named "russStuff", the code is:
set the unicodeText of fld “russStuff” to uniencode(tRussFldFromDB,”utf8”) --for pre LC 7.0
put textDecode(tRussFldFromDB,”utf8”) into fld “russStuff” -- for LC 7.0+
To get Russian text from the field and put it into your database:
put unidecode(the unicodeText of fld “russStuff","utf8") into tRussTxt --for pre LC 7.0
put textEncode(the text of fld “russStuff”,”utf8”) into tRussTxt --for LC 7.0+
Pete
lcSQL Software