LDB
LDB

Reputation: 692

Neo4j - how to display correctly french characters in the query result

I am running this query returning this result set (Neo4j version is 2.2.3):

neo4j-sh (?)$ MATCH (n:Language) where (upper(n.english_name_of_language) =~ '.*CRE.*') RETURN n.french_name_of_language;
+---------------------------------------------+
| n.french_name_of_language                   |
+---------------------------------------------+
| "cr�oles et pidgins bas�s sur l'anglais"    |
| "cr�oles et pidgins bas�s sur le fran�ais"  |
| "cr�oles et pidgins bas�s sur le portugais" |
| "cree"                                      |
| "cr�oles et pidgins"                        |
| "ha�tien; cr�ole ha�tien"                   |
| "muskogee"                                  |
+---------------------------------------------+
7 rows
91 ms
neo4j-sh (?)$ 

How can I display correctly the french characters?

Upvotes: 0

Views: 644

Answers (2)

logisima
logisima

Reputation: 7458

Are you on GNU/Linux, mac or on windows ?

If you are on an unix like, can you give me the result of 'locale' & 'env'command into a terminal ?

How do you have create your data and with each encoding ?

When I create a node with the browser or my command line, my query result is good :

simard@fermat:neo4j-community-2.2.3 # bin/neo4j-shell 
Welcome to the Neo4j Shell! Enter 'help' for a list of commands
NOTE: Remote Neo4j graph database service 'shell' at port 1337

neo4j-sh (?)$ match (n:Test) return n;
+------------------------+
| n                      |
+------------------------+
| Node[0]{name:"Benoît"} |
+------------------------+
1 row
260 ms
neo4j-sh (?)$ exit

bsimard@fermat:neo4j-community-2.2.3 # env | grep UTF
LANG=fr_FR.UTF-8
MDM_LANG=fr_FR.UTF-8

bsimard@fermat:neo4j-community-2.2.3 # locale
LANG=fr_FR.UTF-8
LANGUAGE=fr:en_US:en
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=


neo4j-sh (?)$ create (n:Test {name:'ééé'});
+-------------------+
| No data returned. |
+-------------------+
Nodes created: 1
Properties set: 1
Labels added: 1
17 ms

neo4j-sh (?)$ match (n:Test) return n;
+------------------------+
| n                      |
+------------------------+
| Node[3420]{name:"ééé"} |
+------------------------+
1 row
19 ms

Upvotes: 1

LDB
LDB

Reputation: 692

I loaded the CSV file in a text editor (TextMate) and I did a Save As and selected encoding UTF-8. Deleted the data and reloaded and now all french characters are correctly displayed, like these:

n.french_name_of_language adyghé aléoute araméen d'empire (700-300 BCE) arménien arménien asturien; bable; léonais; asturoléonais azéri bamiléké, langues biélorusse tibétain tibétain amérindiennes de l'Amérique centrale, langues tchétchène slavon d'église; vieux slave; slavon liturgique; vieux bulgare créoles et pidgins basés sur l'anglais créoles et pidgins basés sur le français créoles et pidgins basés sur le portugais tatar de Crimé créoles et pidgins néerlandais moyen (ca. 1050-1350) néerlandais; flamand néerlandais; flamand égyptien élamite espéranto éwé éwondo féroïen géorgien géorgien gaélique; gaélique écossais suisse alémanique; alémanique; alsacien haïtien; créole haïtien hébreu indonésien indo-européennes, langues judéo-persan judéo-arabe coréen kpellé carélien judéo-espagnol macédonien macédonien austronésiennes, langues mendé langues non codées moré nord-amérindiennes, langues ndébélé du Sud ndébélé du Nord népalais nigéro-kordofaniennes, langues niué norvégien nynorsk; nynorsk, norvégien norvégien bokmål norvégien nyankolé phénicien réservée à l'usage local aroumain; macédo-roumain sud-amérindiennes, langues écossais sémitiques, langues sino-tibétaines, langues soninké sérère sumérien suédois télougou tigré indéterminée zandé, langues

Upvotes: 0

Related Questions