On 12/14/07, Kalyani Phadke <[EMAIL PROTECTED]> wrote: > Whats default encoding in SQLite3 ? How does SQLite3 handles storing > Japanese/Chinese text in database? I know in SQL express/sql server I > have to use nVarchar/nchar/ntext datatypes to store Japanese/Chinese > text in database. It seems that in SQLite3 column having text datatype > can also store chinese characters..
SQLite assumes TEXT data is Unicode. You can work with it in either UTF-8 by using the *_text() APIs, or UTF-16 using the *_text16() calls. It will convert between the two encodings as necessary. The default storage encoding on disk is UTF-8, but it can be changed to UTF-16 with a PRAGMA. Note that I said it "assumes" the data is in that form. SQLite does not validate the encoding, so it is possible to store text data in some other encoding, like SJIS. You will just get strange results when asking SQLite to convert the data, such as when storing it with *_text(), but retrieving it with *_text16(). The sqlite3 shell is intended to work with UTF-8, but because of the way different platforms handle the terminal/console encodings, it can be difficult to use properly. ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------