2

The Cypher-script "Umlauts.cypher" (UTF-8, created in Windows-environment) contains one transaction for importing an "umlaut-object" containing some umlauts:

:BEGIN
CREATE(:Umlautobj{text:"ÄäÖöÜü"});
:COMMIT

For piping the script (Windows environment) the following code is used in a cmd-shell

TYPE Umlauts.cypher|cypher-shell.bat -u neo4 - p secret

Now, I try a Cypher-Query(Firefox-Browser) to get the text-information from the new node:

MATCH (n:Umlautobj) RETURN n.text

I get:

"ÄäÖöÜü"

But I expected to get:

"ÄäÖöÜü"

How can I import umlauts correctly?

[Windows 10, neo4j-community 3.5.15, neo4j-DB on the same machine]

CB_Dev
  • 41
  • 5

1 Answers1

0

I was having the same issue and searching for the solution. Couldn't find anything so write a small python script to resolve this.

    from py2neo import Graph
    neo_url = 'http://neo4j:password@localhost:7474/db/data'
    graph = Graph(neo_url)
    file_name = "test.cypher"

    with open(file_name, encoding="utf8") as file_in:
        query = ""
        for line in file_in:        
            if line.strip().lower() == ":begin" or line.strip().lower() == ":commit":
                continue

            query += line
            if line.strip()[-1] == ";":
                graph.run(query)
                query = ""
Alessio
  • 3,404
  • 19
  • 35
  • 48
Aftab
  • 39
  • 1
  • 6