mercredi 6 avril 2016

How to execute SQLite script with UTF8?

I'm trying to .read a SQLite script that contains some German characters:

sqlite>
.open test.db
.read test.sql

I've saved the sql file as utf8 without BOM because sqlite3 wouldn't read it with BOM and complains about an error in line 1.

sqlite3 doesn't seem to read it as utf8 because when I select a row with a ü all I get are question marks ?. If I however add a ü in the console and select the same row the correct character is showed.

I also tried it with powershell:

Get-Content test.sql -encoding utf8 | .\sqlite3.exe test.db

but the result was the same.

What do I have to do to execute a ut8 sql script?

(I deleted the database for each test)

Aucun commentaire:

Enregistrer un commentaire