I'm an UTF-8 expert. Code page 65001 is CP_UTF8, look here (
http://msdn.microsoft.com/en-us/library/windows/desktop/ms683169(v=vs.85).aspx
 ).

I know that code page 437 (alias OEM) works. But the ü-character isn't
correct encoded in the database file.
The UTF-8 hex byte sequence of ü is \xBC\xC3. If you look at the database
via hexdump or xxd you can see that the ü-character is encoded with the hex
sequence 0x81. That's the OEM encoding and not UTF-8. I use my database on
different operating systems. Thus, it is very important that all characters
are correctly UTF-8 encoded.

The sqlite3 command line app doesn't write the string correctly to the
database file. It uses the terminal (cmd) encoding instead the 'PRAGMA
encoding' statement.

                                                Jens

On Tue, Dec 27, 2011 at 6:29 PM, Black, Michael (IS) <michael.bla...@ngc.com
> wrote:

> I"m not a UTF expert but codepage 437 seems to work fine for your example.
>
>
>
> codepage 65001 is not "real" UTF-8 according to several google sources.
>
>
>
> You do have to use Lucida font.
>
>
>
> C:\chcp 437
>
> Active code page: 437
>
> C:\sqlite test.db
> SQLite version 3.7.9 2011-11-01 00:52:41
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> select length('füchsen');
> 7
> sqlite> .quit
>
> C:\chcp 65001
> Active code page: 65001
>
> C:\Documents and Settings\s360740.DIFL1ITE0017341\My Documents\Visual
> Studio 2005\Projects\sqlite\Debug>sqlite
> SQLite version 3.7.9 2011-11-01 00:52:41
> Enter ".help" for instructions
> Enter SQL statements terminated with a ";"
> sqlite> select length('füchsen');
> aborts....
>
>
>
>
>
> Michael D. Black
>
> Senior Scientist
>
> Advanced Analytics Directorate
>
> Advanced GEOINT Solutions Operating Unit
>
> Northrop Grumman Information Systems
>
> ________________________________
> From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org]
> on behalf of Jens Frederich [jfreder...@gmail.com]
> Sent: Tuesday, December 27, 2011 1:59 AM
> To: sqlite-users@sqlite.org
> Subject: EXT :[sqlite] [shell] utf-8 bug
>
> Hi all,
>
> I believe there is a bug in shell tool on Windows. I've tried to store
> utf-8 encoded literals in my test db. Do the following to reproduce the
> issue:
>
> 1. Open a Windows Console (cmd.exe)
> 2. chcp 65001  # change cmd.exe code page from 437(OEM) to utf-8
> 3. Run the shell
>   > sqlite3.exe test.db
>   > create table test(id integer primary key, value text);
>   > insert into test (id, value) values (1, 'füchsen'); # literial with
> multi byte characters
>
> The shell unexpectantly closed on the last command.
>
> What is the preferred way to save utf-8 encoded literals with the windows
> shell tool?
>
>                                              Jens
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to