[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 520
  • Last Modified:

European characters garbled when inserted using SQLite for .NET

I have a problem where foreign characters get messed up when I write them to the database from .NET. Sample code made as simple as possible:

Dim cnn As New System.Data.SQLite.SQLiteConnection("test.db;UseUTF16Encoding=true")
cnn.Open()
Dim cmd As New System.Data.SQLite.SQLiteCommand("INSERT INTO test (test) VALUES ('Àlex')", cnn)
cmd.ExecuteNonQuery()

Result:

When I look at the table in SQLite Administrator, the field value shows as "Àlex". When I run the exact same query directly in SQLite Administratr, the field value shows correctly. What am I doing wrong?
0
wwarby
Asked:
wwarby
1 Solution
 
wdosanjosCommented:
I think SQLite Administrator uses a different char encoding than your program.  Is there a setting where you can change that?

When you retrieve the value on .NET, does it show correctly?
0
 
wwarbyAuthor Commented:
wdosanjos: Idiotically, I hadn't even thought to try reading the data back in .NET since I could see it was wrong in SQLite Administrator, but you're absolutely right - it comes out exactly as it went in in .NET - it just looks wrong in the SQLite Administrator which makes the problem more of an annoyance than a crippling obstacle. There seems to be no way to change the display in SQLite Administrator but I can live with it. Thanks!
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now