1 #ifndef _json_utf8_hpp_ 2 #define _json_utf8_hpp_ 50 static std::unique_ptr<std::string> json_string_to_utf8(
const std::string &src);
57 static std::unique_ptr<std::string> utf8_to_json_string(
const std::string &src);
61 static char next_char(
const std::string &s,
size_t &index);
63 static unsigned int from_hex(
char c);
65 static char to_hex(
unsigned int i);
67 static void set_and_check_unicode_byte(std::string &dst,
size_t &dst_index,
char c);
69 static void parse_unicode(
70 const std::string &src,
75 static char32_t parse_hex(
76 const std::string &src,
79 static unsigned int utf8_length(uint8_t c);
81 static bool valid_unicode(char32_t uc);
83 static void add_hex_string(std::unique_ptr<std::string> &dst, char32_t uc);
#define NAMESPACE
You can change the namespace of the whole library by changing this value.
Common defs needed everywhere and, as far as is possible, platform specific changes.
Methods to convert JSON format string to UTF-8 and vice-versa.