1

I would like to use "Ä, Ö and Ü" in my sqlite database but when I use the snippet of code below, I am unable to retrieve the accented characters.

I am accessing the database using android or via sqlite3

CREATE TABLE haltestellen (
id integer primary key autoincrement,
name varchar(64)
);

insert into haltestellen(name) values("Bärenhof");
David Segonds
  • 83,345
  • 10
  • 45
  • 66
user1801564
  • 53
  • 1
  • 4
  • 2
    How do you access the database? (Language? driver?) – CL. Nov 16 '12 at 18:09
  • 1
    Please show the code that you use to access the DB. – CL. Nov 27 '12 at 07:33
  • If one of the answers solves your question you could mark it as such, otherwise you might want to comment on it, so we can give better answers. – Tim Dec 06 '12 at 18:31

2 Answers2

3

Sqlite only supports UTF-8 and UTF-16 (see this question) there should not be a problem with your charset.

I guess that the terminal or tool you use to make the queries just does not support UTF-8 (or doesn't have it enabled). Just use a terminal or tool that supports UTF-8 and you should be fine.

As you do not give any more information I assume that you use the windows terminal cmd.exe. You could try what was suggested in this question:

chcp 65001

Still, for a better suited answer you will have to provide more information about your setup, like what are you actually trying where.

Community
  • 1
  • 1
Tim
  • 2,051
  • 17
  • 36
  • I'm using SQLITE3 in Terminal on OSX. I've enabled umlauts in the terminal in general via this post: http://superuser.com/questions/403753/cannot-type-any-special-character-or-umlaut-in-terminal. However, when I go into sqlite, it still won't accept special characters. – mphair Feb 17 '14 at 15:05
1
CREATE TABLE haltestellen (
id integer primary key autoincrement,
name varchar(64) charset utf8
);

insert into haltestellen(name) values("Bärenhof");

If this doesn't work, you should show the code you use and make sure that everything is using utf8

a3f
  • 8,517
  • 1
  • 41
  • 46