我有一个列表视图,它由来自SQLite数据库的数据填充。我的一个领域是一个具有unicode特征的标记,可以是整圈:\ u25cf或者打开的圈:\ u25cb。当我在文本字段中使用硬编码字符串时,这两个字符都能正确显示。但是,在我的listView中,我看到的是文本编码而不是字符。从SQLite数据库显示一个Unicode字符
有谁知道为什么这是...以及如何让unicode字符显示?
谢谢。
更新:
插入码是
private void loadRecords() throws IOException {
final Resources resources = mContext.getResources();
InputStream inputStream = resources.openRawResource(R.raw.records);
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
try {
String line;
while ((line = reader.readLine()) != null) {
String[] strings = TextUtils.split(line, ",");
if (strings.length <2) continue;
long id = addRecord(strings[0].trim(),strings[1].trim(),strings[2].trim(),strings[3].trim(),
strings[4].trim(),strings[5].trim(),strings[6].trim());
}
} finally {
reader.close();
}
}
与所述资源是与一个线是例如csv文件
primaryKey,name,surname,address,phone,email,\u25CB
因为您没有在数据库中正确插入它。 – njzk2
你是什么意思,你是“看到文字编码,而不是字符”?它究竟如何显示? –
我的意思是,lisView中的元素显示为“\ u25CB”,而不是显示一个空心圆。 – user1791710