Solved

European characters garbled when inserted using SQLite for .NET

Posted on 2011-02-25
2
506 Views
Last Modified: 2012-05-11
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
Comment
Question by:wwarby
2 Comments
 
LVL 23

Accepted Solution

by:
wdosanjos earned 500 total points
ID: 34982078
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
 
LVL 1

Author Comment

by:wwarby
ID: 34982177
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Read about achieving the basic levels of HRIS security in the workplace.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now