vendredi 8 mai 2015

SQLite Windows Phone character encoding not working

I'm working on a Windows Phone 8.1 app with an SQLite database to store localized strings. I use the SQLite for Windows Phone 8.1 extension for this, and I'm programming in C#. However, when I store the localized strings in the database, special characters like 'å', 'ö' etc. appear as '�' in the SQLite database.

I already tried the following:

1) convert the C# strings to UTF-8, UTF-16 or Unicode before storing them in the database, with no help. It appears that encoding strings in C# is useless.

2) set the SQLite database to use UTF-16 encoding with PRAGMA encoding="UTF-16"; when creating the database. The pragma is correctly processed, but the special characters are still '�'.

My assumption is that there is something going wrong in the C++ code of the SQLite for Windows Phone 8.1 extension.

Storing the localized strings elsewhere is not an option, so how can I get the SQLite for Windows Phone 8.1 extension to store the special characters correctly?

Aucun commentaire:

Enregistrer un commentaire