Miosix
2.0alpha1
|
#include <unicode.h>
Public Types | |
enum | error { OK, INSUFFICIENT_SPACE, INVALID_STRING } |
Static Public Member Functions | |
template<typename Iter > | |
static char32_t | nextUtf8 (Iter &it, Iter end) |
template<typename Iter > | |
static char32_t | nextUtf8 (Iter &it) |
static std::pair< error, int > | putUtf8 (char *dst, char32_t c, int dstSize) |
static std::pair< error, int > | utf8toutf16 (char16_t *dst, int dstSize, const char *src) |
static std::pair< error, int > | utf16toutf8 (char *dst, int dstSize, const char16_t *src) |
static std::pair< bool, int > | validateUtf8 (const char *str) |
Static Public Attributes | |
static const char32_t | invalid =0xffffffff |
Represents an invalid code point. | |
Result codes for unicode related conversion stuff
|
inlinestatic |
Peek an unicode code point out of an iterator into an utf8 string
it | an iterator into an utf8 encoded string |
end | iterator one past the last character of the string |
|
inlinestatic |
Peek an unicode code point out of an iterator into an utf8 string
it | an iterator into an utf8 encoded string, the string is assumed to be nul-terminated |
|
static |
Put an unicode code point into a character array, converting it to utf8.
dst | pointer to the buffer where the character is to be written |
c | an unicode code point (utf32 char) |
dstSize | number of bytes available in dst |
|
static |
Convert an utf16 string in an utf8 one
dst | an utf8 string |
dstSize | size in bytes of dst, to prevent overflow |
src | a nul-terminated utf16 string in system-dependent endianness (i.e: little endian in a little endian machine and big endian in a big endian one) |
|
static |
Convert an utf8 string in an utf16 one
dst | an utf16 string in system-dependent endianness (i.e: little endian in a little endian machine and big endian in a big endian one) |
dstSize | size in units of char16_t of dst, to prevent overflow |
src | a nul-terminated utf8 string |
|
static |
str | an utf8 encoded string |