29 static bool isUTF8(
const std::string &);
37 static std::string
UTF8ToUCS2(
const std::string &,
bool *errors =
nullptr);
45 static std::string
UTF8ToUCS4(
const std::string &,
bool *errors =
nullptr);
53 static std::string
UTF8ToUTF16(
const std::string &,
bool *errors =
nullptr);
61 static std::string
UTF8ToUTF32(
const std::string &,
bool *errors =
nullptr);
68 static std::string
UCS2ToUTF8(
const std::string_view &,
bool *errors =
nullptr);
75 static std::string
UCS4ToUTF8(
const std::string_view &,
bool *errors =
nullptr);
82 static std::string
UTF16ToUTF8(
const std::string_view &,
bool *errors =
nullptr);
89 static std::string
UTF32ToUTF8(
const std::string_view &,
bool *errors =
nullptr);
95 static std::string doUCS2ToUTF8(
const uint8_t *src, uint32_t n,
bool *errors);
96 static std::string doUCS4ToUTF8(
const uint8_t *src, uint32_t n,
bool *errors);
97 static std::string doUTF16ToUTF8(
const uint8_t *src, uint32_t n,
bool *errors);
98 static std::string doUTF32ToUTF8(
const uint8_t *src, uint32_t n,
bool *errors);
101 static uint32_t fromUTF8(
const uint8_t *&src, uint32_t &size);
102 static void toUTF8(std::string &dst, uint32_t c,
bool *errors);
105 static uint32_t s_invalid;
106 static uint32_t s_replacement;
Unicode utility functions.
Definition Unicode.h:19
static std::string UCS4ToUTF8(const std::string_view &, bool *errors=nullptr)
Convert from UCS-4 to UTF-8.
Definition Unicode.cpp:210
static std::string UTF16ToUTF8(const std::string_view &, bool *errors=nullptr)
Convert from UTF-16 to UTF-8.
Definition Unicode.cpp:220
static bool isUTF8(const std::string &)
Test UTF-8 string for validity.
Definition Unicode.cpp:77
static std::string UTF8ToUCS4(const std::string &, bool *errors=nullptr)
Convert from UTF-8 to UCS-4 encoding.
Definition Unicode.cpp:116
static std::string UTF8ToUTF16(const std::string &, bool *errors=nullptr)
Convert from UTF-8 to UTF-16 encoding.
Definition Unicode.cpp:139
static std::string UTF8ToUCS2(const std::string &, bool *errors=nullptr)
Convert from UTF-8 to UCS-2 encoding.
Definition Unicode.cpp:89
static std::string UCS2ToUTF8(const std::string_view &, bool *errors=nullptr)
Convert from UCS-2 to UTF-8.
Definition Unicode.cpp:200
static std::string UTF8ToUTF32(const std::string &, bool *errors=nullptr)
Convert from UTF-8 to UTF-32 encoding.
Definition Unicode.cpp:174
static std::string UTF32ToUTF8(const std::string_view &, bool *errors=nullptr)
Convert from UTF-32 to UTF-8.
Definition Unicode.cpp:230