Non-ASCII character encoding in visualizer


#1

Hey I’m trying to get the encoding right in the visualizer, and am wondering if there is any settings / transformations that I am missing. I have some utf-8 characters that showed up properly (as text) in the console, but got scrambled in the graph visualizer.

Result from graql console (which is fine)

Query

match $x id "82149512"; $x has name $z; select $z;

Result

{z: value "\u6D4E\u5357\u4E50\u6D3B" isa name}

Result from dashboard (which is not)

I tried to check the response from the dashboard rest api and here’s the result:

Request

curl -XGET -H "Accept:application/hal+json" "http://localhost:4567/dashboard/explore/82149512?keyspace=grakn"

Response

{"response":{"_baseType":"ENTITY","_links"......"self":{"href":"/graph/concept/196664?keyspace=grakn&offsetEmbedded=0"}},"_type":"name","_value":"\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD\uFFFD","_id":"196664"}]},"_type":"reference","_id":"82149512"}}


#2

Hello!

We tried to reproduce this issue and got the following:

Data

  1 insert                                                                                                                                                                                                   
  2 person sub entity has name;
  5 name sub resource datatype string;
  6 
  7 $x isa person has name "济南乐活";

Request

curl -XGET -H "Accept:application/hal+json" "http://localhost:4567/dashboard/explore/24616?keyspace=grakn"

Response

{"response":{"_baseType":"ENTITY","_links":{"explore":[{"href":"/graph/concept/24616?keyspace=grakn&offsetEmbedded=0"}],"self":{"href":"/graph/concept/24616?keyspace=grakn&offsetEmbedded=0"}},"_embedded":{"name":[{"_direction":"OUT","_baseType":"RESOURCE","_links":{"explore":[{"href":"/graph/concept/28712?keyspace=grakn&offsetEmbedded=0"}],"self":{"href":"/graph/concept/28712?keyspace=grakn&offsetEmbedded=0"}},"_type":"name","_value":"济南乐活","_id":"28712"}]},"_type":"person","_id":"24616"}}

Dashboard

So we see the characters in the dashboard. Just to clarify- you are expecting to see the UTF8 representation in the dashboard response (and the dashboard as well?)?

Alex


#3

Yeah that’s what I would expect. It turns out to be related to the locale settings of the residing machine, after switching that to local configurations things are cool.