Hi Wei Wang, Did you populate the database from the sqlite3 CLI tool, your own C program, or from another language?
Do you see this when you create a database from scratch, if you use a database created by another program, or in both cases? If you populated the database from the sqlite3 CLI tool, can you post the commands you used to populate the database? If you populated the database from your own C program, can you post a simple test program that populates the database? If you populated the database from another language, can you post a test snippet that shows how you populated the database along with a pointer to which library you are using? What kind of system, CPU, and operating system(s) do you see this behavior on? It should be no problem for sqlite3 to deal with the Latin-1 characters you are using if you do it right. The trick is that sqlite3 is designed to deal with both UTF-8 and UTF-16 (le or be). SQLite stores which encoding is used in the database. The API allows you to use both UTF-8 and UTF-16 encoding, regardless of which encoding is actually used to store the data. I think this is documented properly in sqlite.org, and I found an excellent writeup (though 5 years old) at: http://www.mimec.org/node/297 I also like the Unicode link from Igor. Chris On Wed, Jun 8, 2016 at 3:49 AM, Wang, Wei <wei.w...@emc.com> wrote: > Thanks for your reply! But I found the Latin-1 encoded characters are listed > in the Unicode chart. http://unicode.org/charts/PDF/U0080.pdf > > > Best Regards, > Wang Wei > > -----Original Message----- > From: sqlite-users-boun...@mailinglists.sqlite.org > [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Igor > Tandetnik > Sent: Tuesday, June 07, 2016 10:20 PM > To: sqlite-users@mailinglists.sqlite.org > Subject: Re: [sqlite] Latin-1 characters cannot be supported for Unicode > > On 6/7/2016 3:43 AM, Wang, Wei wrote: >> I met a problem that was maybe caused by the encoding of SQLite. I inserted >> a item which including some Latin1 characters like Ç and à into a table. >> Then I opened the database with SQLite Developer. After I setting the >> encoding to ANSI, the display and the query result for that table were OK. >> However after I setting the encoding to Unicode, these Latin1 characters >> could not be displayed normally, and could not be queried out. Please see >> the attached pictures for the details. > > A byte sequence containing Latin-1-encoded characters Ç or à is not in fact a > valid byte sequence in any Unicode encoding - neither UTF-8 nor > UTF-16 nor any other. If you want Unicode data in your database, then store > Unicode data, and not ANSI, in your database. > -- > Igor Tandetnik > > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ > sqlite-users mailing list > sqlite-users@mailinglists.sqlite.org > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users