Sqlite encoding android

I have an encoding problem in my database. This database is first imported from another application (written in .NET, therefore a microsoft application). So I get the .sql file and then upload it and run it in myphp admin, and there I see that varchars are in utf8.

Then I use this (WONDERFUL, by the way) script to create the sqlite database AUTOMATICALLY:

https://gist.github.com/943776

Then I have a database file, and I put it in the folder with the resources of my application, using mainly this technique: http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android -applications /

use a database, not create a new one.

Well everything works fine, the only thing is that my apopp is in Spanish, and the encoding is not quite suitable for letters such as è, é, ª etc. I checked with PRAGMA coding;

but encodign if utf-8, what would you advise me? I mean the part from rewriting the database ???

Thank you so much

+1
source share
2 answers

Android sqlite uses by default UTF-8. And you can use only UTF-8and UTF-16. You checked to initialize your rows extracted from sqlite, like this:

new String(row.getString().getBytes(), "UTF-8")

You can also check other parameters with pragma .

0
source

I found that SQLite Database browser 2.0 only shows Western (ISO Latin 1) correctly when importing csv made in Numbers

0

All Articles