波斯语的sqlite数据库 [英] sqlite database in persian language
问题描述
我试图从一个 csv 文件创建一个 sqlite 数据库.我按照本页中的说明做了:使用您自己的 sqliteandroid 中的 db 和这个:将 csv 导入 sqlite
I tried to create a sqlite database from a csv file. I did it as it is said in this page : using your own sqlite db in android and this : import csv to sqlite
但问题是当表格包含波斯语/阿拉伯语的数据时.sqlite 将该字符显示为_".我该怎么办?
but the problem is when the table contains data in farsi/arabic language. sqlite shows that character as "_". what should I do?
附注.我想在一个 android 项目中使用这个数据库.
PS. I want to use this DB in an android project.
我使用以下代码将 csv 导入到 sqlite:
edit: I import csv to sqlite using this code:
CREATE TABLE "android_metadata"("locale" TEXT DEFAULT 'en_US');
CREATE TABLE "addresses"(_id integer PRIMARY KEY,
nametext, meaning text);
.separator ","
.import test.csv mydb
推荐答案
sqlite 支持 UTF-8、UTF-16,这足以存储阿拉伯语或波斯语.
sqlite supports UTF-8, UTF-16 and this is quite enough to store arabic or persian.
很可能您得到_",因为导入工具需要的字符集与原始文件的字符集不同.
Most probably you get "_" because the import tool expects different charset than the charset of your original file.
这篇关于波斯语的sqlite数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!