Solved

European characters garbled when inserted using SQLite for .NET

Posted on 2011-02-25
2
512 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Do you have a plan for Continuity?

It's inevitable. People leave organizations creating a gap in your service. That's where Percona comes in.

See how Pepper.com relies on Percona to:
-Manage their database
-Guarantee data safety and protection
-Provide database expertise that is available for any situation

Question has a verified solution.

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

These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
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…

632 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