ArduinoJson can decode Unicode escape sequences (\uXXXX) in JSON documents, but this feature is disabled by default.

Description

When ARDUINOJSON_DECODE_UNICODE is set to 1, deserializeJson() converts the Unicode escape sequences to UTF-8 characters.

When ARDUINOJSON_DECODE_UNICODE is set to 0, deserializeJson() returns NotSupported when the input contains a Unicode escape sequence.

The default value is 0.

How to enable Unicode characters in ArduinoJson?

To enable support for Unicode escape sequences, you must define ARDUINOJSON_DECODE_UNICODE to 1 before including the library:

#define ARDUINOJSON_DECODE_UNICODE 1
#include <ArduinoJson.h>

Example

StaticJsonDocument<300> doc;

deserializeJson(doc, "{'firstname':'Beno\\u00EEt'}");
    
Serial.println(doc["firstname"].as<char*>()); // Benoît

👨‍🏫 Try this example online

Several .ino or .cpp files?

Be careful if several compilation units compose your program, i.e., if your project contains several .ino or .cpp files.

You should define the same value of ARDUINOJSON_DECODE_UNICODE in each compilation unit; otherwise, the executable will be much bigger because it will contain two variants of the library.