How to use french accentued characters from a database
When I extract data from a sqlite database, the accentued character are wrong (diamond with ?) like utf-8 problem in html
var rows = db.execute('SELECT fr FROM taxons WHERE id=?',rowdata);
var taxon_name = Ti.UI.createLabel({
text: rows.field(0)
});
win11.add(taxon_name);
Need something like utf8_encode() in PHP ! Any ideas ?
4 Answers
-
Accepted Answer
I used sqlite with unicode and had not problems so far.
Are u storing the data in the right encoding? -
try to escape the text:
var rows = db.execute('SELECT fr FROM taxons WHERE id=?',rowdata); var taxon_name = Ti.UI.createLabel({ text: escape(rows.field(0)) // this line }); win11.add(taxon_name);
-
escape does'nt work!
I've got %uFFFD (diamond with ?) and %20 (space) -
I thought it was unicode.
But, Yes indeed, the error was there !