我在数据库中插入以下文本:
.Pour lemon juice immediately on fruits.
.In a little water add sugar and half melt it on heat.
.Mix melted sugar to the fruits. Refrigerate it and serve the fruit salad chilled.
.Note: Salt and chaat masala can also be used
插入这个数据不会产生错误但是当我显示上面的数据时 我得到这个:
• Pour lemon juice immediately on fruits.
• In a little water add sugar and half melt it on heat.
• Mix melted sugar to the fruits. Refrigerate it and serve the fruit salad chilled.
• Note: Salt and chaat masala can also be used
句点替换为 ,Ä¢
。
请指导我,如何显示插入的句点符号而不是上面的输出。
最佳答案
您可能想确保您插入的字符确实如您所想,例如 U+2e,ASCII 句点。
如您所见here,有很多“句号”字符,并且它只需要使用一种“非标准”变体来阻塞不知道如何呈现它的应用程序。
也有可能您看到的三个字符序列 (,Ä¢
) 实际上只是您要插入的字符的 UTF-8 编码。
这可能是更可能的情况,因为文本中那些前导的“句号”可能更适合作为项目符号点边距,例如 U+2022这将为您提供 UTF-8 代码 0xe2 0x80 0xa2
(0xa2 是分符号 - 虽然其他字节不匹配,但这正是您正在寻找的东西)。
可能最好的发现方法是将发送到 SQL INSERT 语句的数据记录到某个文件中,然后对该文件进行十六进制转储以查看错误字符是什么。
如果它不是 U+2e 处的 ASCII 样式句点,那可能就是造成问题的原因。
尽管 SQLite 可能能够存储它,但这并不能保证您用来显示的任何东西都能完成任务。
关于iphone - 将特殊符号点(.)插入sqlite?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12794637/