Neo4j REST Encoding

孤街醉人 提交于 2019-12-24 05:06:55

问题


I'm using neo4jclient. When I try to create/update an node, special chars like äöü are replaced with �. Do I have to set a specific http header like content-type, content-encoding? If yes, what kind of header and what is the value of this header?

Thanks.

EDIT: This is how the request looks like:

POST http://...........:7474/db/data/batch HTTP/1.1

Accept: application/json;stream=true

User-Agent: RestSharp 103.1.0.0

Content-Type: application/json

Host: ............:7474

Content-Length: 267

Accept-Encoding: gzip, deflate


[

  {

"method": "POST",
"to": "/node",
"body": {
  "Name": "äöü",
  "State": "Active",
  "Id": 0,
  "CreateDate": "2012-07-12T18:48:45.3343526+02:00",
  "ChangeDate": "0001-01-01T00:00:00+00:00"
},
    "id": 0
  }
]

Or is it bug in the batch execution? If yes, I'll need the fix very quick:)


回答1:


Now it works

After analyzing the messages.log we found out, that the file.encoding wasn't utf-8.

--> DEBUG [neo4j.diagnostics]: file.encoding = Cp1252

So we set in the neo4j-wrapper.conf file this property:

wrapper.java.additional.3=-Dfile.encoding=UTF-8

Now it works!!! :)

Thanks to my brother! Always good to know a Java developer. :)




回答2:


There are tests for this in the codebase, so it should be handled correctly, see https://github.com/neo4j/community/blob/master/server/src/functionaltest/java/org/neo4j/server/rest/BatchOperationFunctionalTest.java#L322 . However, there might be encoding problems in the client?



来源:https://stackoverflow.com/questions/11454352/neo4j-rest-encoding

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!