如何在sqlite数据库中使用Unicode字符

如何在sqlite数据库中使用Unicode字符

本文介绍了如何在sqlite数据库中使用Unicode字符,如Germanic umlaut?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的sqlite数据库中使用Ä,Ö和Ü,但是当我使用下面的代码片段时,我无法检索重音字符。



我正在使用android或通过sqlite3访问数据库

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

插入到haltestelen(name)值(Bärenhof); Sqlite只支持UTF-8和UTF-16(支持UTF-8和UTF-16)请参阅)



我想您用来进行查询的终端或工具不支持UTF-8(或不支持已启用)。只要使用支持UTF-8的终端或工具,就应该可以了。



由于你不提供任何更多的信息,我假设你使用windows终端cmd。可执行程序。
您可以尝试中建议的内容:



chcp 65001



适当的答案,你将不得不提供更多的有关您的设置的信息,如你实际尝试的地方。


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");
解决方案

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.

这篇关于如何在sqlite数据库中使用Unicode字符,如Germanic umlaut?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-28 03:19