encodingjson-ld

How to encode diacritics in JSON-LD?


In JSON-LD values I have german characters öäüß - company name, address and so on.

Should they be encoded on any way? Like with RFC1738, öäüß -> %C3%B6%C3%A4%C3%BC%C3%9F

Or no need?


Solution

  • JSON-LD is JSON, which allows strings to use the full spectrum of Unicode (UTF-8) characters. Escapes are only needed for a few of these, due to constraints of the format. For instance, a newline is encoded using \n. Nothing outside of the ASCII range needs to be specially encoded.