【问题标题】:Neo4j SDN4 and unicode symbolsNeo4j SDN4 和 unicode 符号
【发布时间】:2017-03-21 18:35:50
【问题描述】:

我在我的 Neo4j 数据库中使用 SDN4 存储以下字符串:

Panda Antivirus Pro is the brand’s entry level security product: a powerful antivirus tool that protects your system in an effective – and unobtrusive – way.

但在我的 Neo4j 节点内部存储之后,我有以下内容:

Panda Antivirus Pro is the brand���s entry level security product: a powerful antivirus tool that protects your system in an effective ��� and unobtrusive ��� way.

在我的 ogm.properties 中,我有以下属性:

driver=org.neo4j.ogm.drivers.bolt.driver.BoltDriver
URI=bolt://neo4j:neo4j@localhost

为什么我有�而不是普通字符?

在本地,在我的 Windows 10 机器上,我没有看到此类问题。该问题仅出现在我的 Linux openSUSE 42.1 临时环境中。

【问题讨论】:

    标签: neo4j character-encoding opensuse spring-data-neo4j-4 neo4j-ogm


    【解决方案1】:

    您的原始字符串没有 Neo4j 所期望的 UTF-8 编码,因此不使用 UTF-8 的字符被替换为 Replacement Character,U+FFFD。

    【讨论】:

    • 感谢您的回答。如何解决这个问题?为什么相同的代码可以在我的 Windows 机器上运行而在 openSUSE 上却不能运行?
    • @alexanoid 因为不同的机器有不同的默认设置。例如,如果您没有在某些地方明确指定编码,则将使用默认平台编码。这可能是一台机器上的 UTF8 和另一台机器上的其他东西。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多