Search code examples
utf-8emojidgraph

Dgraph - cannot store emoji


I have an issue when storing emoji in facets in Dgraph database (which store UTF-8 string).

It work fine with some but I get a parse error when reading the value for some others:

Unable to marshal response

For example: 🥮 that has these properties.

I'm writing into dgraph using the Java client and setting the value using ByteString.copyFromUtf8(val);

Any idea about why it works well for some emojis and why I get error with some others?


Solution

  • This error was due to the way Dgraph was creating JSON responses for queries, as detailed in this GitHub issue: https://github.com/dgraph-io/dgraph/issues/2662. This is fixed in newer versions of Dgraph (v1.0.12+).

    You can try it out with the latest v1.0.12-rc6 v1.0.12 version.