Unicode conversion functions. More...
#include <libppbase/base/Unicode.h>
Static Public Member Functions | |
static bool | isUtf16 (const char *s) |
Checks if a string contains UTF-16 characters. | |
static bool | isUtf16 (const char *s, size_t len) |
Checks if a string contains UTF-16 characters. | |
static bool | isUtf16 (const String &s) |
Checks if a string contains UTF-16 characters. | |
static bool | isUtf8 (const char *s) |
Checks if a string contains UTF-8 characters. | |
static bool | isUtf8 (const char *s, size_t len) |
Checks if a string contains UTF-8 characters. | |
static bool | isUtf8 (const String &s) |
Checks if a string contains UTF-8 characters. | |
static bool | isValidUtf8 (const char *s) |
Checks if an UTF-8 encoded string contains valid UTF-8. | |
static bool | isValidUtf8 (const char *s, size_t len) |
Checks if an UTF-8 encoded string contains valid UTF-8. | |
static bool | isValidUtf8 (const String &s) |
Checks if an UTF-8 encoded string contains valid UTF-8. | |
static WString | latin1OrUtf8ToUtf16 (const char *s) |
Converts a string from LATIN-1 (ISO-8859-1) or UTF-8 to UTF-16. | |
static WString | latin1OrUtf8ToUtf16 (const char *s, size_t len) |
Converts a string from LATIN-1 (ISO-8859-1) or UTF-8 to UTF-16. | |
static WString | latin1OrUtf8ToUtf16 (const String &s) |
Converts a string from LATIN-1 (ISO-8859-1) or UTF-8 to UTF-16. | |
static WString | latin1ToUtf16 (const char *s) |
Converts a string from LATIN-1 (ISO-8859-1) to UTF-16. | |
static WString | latin1ToUtf16 (const char *s, size_t len) |
Converts a string from LATIN-1 (ISO-8859-1) to UTF-16. | |
static WString | latin1ToUtf16 (const String &s) |
Converts a string from LATIN-1 (ISO-8859-1) to UTF-16. | |
static String | latin1ToUtf8 (const char *s) |
Converts a string from LATIN-1 (ISO-8859-1) to UTF-8. | |
static String | latin1ToUtf8 (const char *s, size_t len) |
Converts a string from LATIN-1 (ISO-8859-1) to UTF-8. | |
static String | latin1ToUtf8 (const String &s) |
Converts a string from LATIN-1 (ISO-8859-1) to UTF-8. | |
static String | utf16ToUtf8 (const wchar_t *s, size_t *rlen=NULL) |
Converts a string from UTF-16 to UTF-8. | |
static String | utf16ToUtf8 (const wchar_t *s, size_t len, size_t *rlen=NULL) |
Converts a string from UTF-16 to UTF-8. | |
static String | utf16ToUtf8 (const WString &s, size_t *rlen=NULL) |
Converts a string from UTF-16 to UTF-8. | |
static String | utf8ToLatin1 (const char *s, char rep= '\0') |
Converts a string from UTF-8 to LATIN-1 (ISO-8859-1). | |
static String | utf8ToLatin1 (const char *s, size_t len, char rep= '\0') |
Converts a string from UTF-8 to LATIN-1 (ISO-8859-1). | |
static String | utf8ToLatin1 (const String &s, char rep= '\0') |
Converts a string from UTF-8 to LATIN-1 (ISO-8859-1). | |
static WString | utf8ToUtf16 (const char *s, size_t *rlen=NULL) |
Converts a string from UTF-8 to UTF-16. | |
static WString | utf8ToUtf16 (const char *s, size_t len, size_t *rlen=NULL) |
Converts a string from UTF-8 to UTF-16. | |
static WString | utf8ToUtf16 (const String &s, size_t *rlen=NULL) |
Converts a string from UTF-8 to UTF-16. |
Unicode conversion functions.
static bool base::Unicode::isUtf16 | ( | const char * | s | ) | [static] |
Checks if a string contains UTF-16 characters.
s | the string to check |
static bool base::Unicode::isUtf16 | ( | const char * | s, | |
size_t | len | |||
) | [static] |
Checks if a string contains UTF-16 characters.
s | the string to check | |
len | string length |
static bool base::Unicode::isUtf16 | ( | const String & | s | ) | [static] |
Checks if a string contains UTF-16 characters.
s | the string to check |
static bool base::Unicode::isUtf8 | ( | const char * | s | ) | [static] |
Checks if a string contains UTF-8 characters.
s | the string to check |
Referenced by base::FileT< size_t >::stat().
static bool base::Unicode::isUtf8 | ( | const char * | s, | |
size_t | len | |||
) | [static] |
Checks if a string contains UTF-8 characters.
s | the string to check | |
len | string length |
static bool base::Unicode::isUtf8 | ( | const String & | s | ) | [static] |
Checks if a string contains UTF-8 characters.
s | the string to check |
static bool base::Unicode::isValidUtf8 | ( | const char * | s, | |
size_t | len | |||
) | [static] |
Checks if an UTF-8 encoded string contains valid UTF-8.
s | the string to check | |
len | string length |
static bool base::Unicode::isValidUtf8 | ( | const String & | s | ) | [static] |
Checks if an UTF-8 encoded string contains valid UTF-8.
s | the string to check |
static bool base::Unicode::isValidUtf8 | ( | const char * | s | ) | [static] |
Checks if an UTF-8 encoded string contains valid UTF-8.
s | the string to check |
static WString base::Unicode::latin1OrUtf8ToUtf16 | ( | const char * | s | ) | [static] |
Converts a string from LATIN-1 (ISO-8859-1) or UTF-8 to UTF-16.
s | the string in LATIN-1 or UTF-8 encoding |
static WString base::Unicode::latin1OrUtf8ToUtf16 | ( | const char * | s, | |
size_t | len | |||
) | [static] |
Converts a string from LATIN-1 (ISO-8859-1) or UTF-8 to UTF-16.
s | the string in LATIN-1 or UTF-8 encoding | |
len | string length |
Converts a string from LATIN-1 (ISO-8859-1) or UTF-8 to UTF-16.
s | the string in LATIN-1 or UTF-8 encoding return the string in UTF-16 encoding |
static WString base::Unicode::latin1ToUtf16 | ( | const char * | s | ) | [static] |
Converts a string from LATIN-1 (ISO-8859-1) to UTF-16.
s | the string in LATIN-1 encoding |
static WString base::Unicode::latin1ToUtf16 | ( | const char * | s, | |
size_t | len | |||
) | [static] |
Converts a string from LATIN-1 (ISO-8859-1) to UTF-16.
s | the string in LATIN-1 encoding | |
len | string length |
Converts a string from LATIN-1 (ISO-8859-1) to UTF-16.
s | the string in LATIN-1 encoding return the string in UTF-16 encoding |
static String base::Unicode::latin1ToUtf8 | ( | const char * | s | ) | [static] |
Converts a string from LATIN-1 (ISO-8859-1) to UTF-8.
s | the string in LATIN-1 encoding |
static String base::Unicode::latin1ToUtf8 | ( | const char * | s, | |
size_t | len | |||
) | [static] |
Converts a string from LATIN-1 (ISO-8859-1) to UTF-8.
s | the string in LATIN-1 encoding | |
len | string length |
Converts a string from LATIN-1 (ISO-8859-1) to UTF-8.
s | the string in LATIN-1 encoding return the string in UTF-8 encoding |
static String base::Unicode::utf16ToUtf8 | ( | const wchar_t * | s, | |
size_t | len, | |||
size_t * | rlen = NULL | |||
) | [static] |
Converts a string from UTF-16 to UTF-8.
If rlen returns a number lower than len, a conversion error has occurred at postion rlen.
s | the string in UTF-16 encoding | |
len | the length of the string | |
rlen | if not NULL, returns number of characters converted |
Converts a string from UTF-16 to UTF-8.
If rlen returns a number lower than len, a conversion error has occurred at postion rlen.
s | the string in UTF-16 encoding | |
rlen | if not NULL, returns number of characters converted |
static String base::Unicode::utf16ToUtf8 | ( | const wchar_t * | s, | |
size_t * | rlen = NULL | |||
) | [static] |
Converts a string from UTF-16 to UTF-8.
If rlen returns a number lower than len, a conversion error has occurred at postion rlen.
s | the string in UTF-16 encoding | |
rlen | if not NULL, returns number of characters converted |
static String base::Unicode::utf8ToLatin1 | ( | const char * | s, | |
size_t | len, | |||
char | rep = '\0' | |||
) | [static] |
Converts a string from UTF-8 to LATIN-1 (ISO-8859-1).
s | the string in UTF-8 encoding | |
len | string length | |
rep | replacement to insert for characters which cannot be representated in LATIN-1 |
static String base::Unicode::utf8ToLatin1 | ( | const char * | s, | |
char | rep = '\0' | |||
) | [static] |
Converts a string from UTF-8 to LATIN-1 (ISO-8859-1).
s | the string in UTF-8 encoding | |
rep | replacement to insert for characters which cannot be representated in LATIN-1 |
Converts a string from UTF-8 to LATIN-1 (ISO-8859-1).
s | the string in UTF-8 encoding | |
rep | replacement to insert for characters which cannot be representated in LATIN-1 |
static WString base::Unicode::utf8ToUtf16 | ( | const char * | s, | |
size_t | len, | |||
size_t * | rlen = NULL | |||
) | [static] |
Converts a string from UTF-8 to UTF-16.
If rlen returns a number lower than len, a conversion error has occurred at postion rlen.
s | the string in UTF-8 encoding | |
len | the length of the string | |
rlen | if not NULL, returns number of characters converted |
static WString base::Unicode::utf8ToUtf16 | ( | const char * | s, | |
size_t * | rlen = NULL | |||
) | [static] |
Converts a string from UTF-8 to UTF-16.
If rlen returns a number lower than len, a conversion error has occurred at postion rlen.
s | the string in UTF-8 encoding | |
rlen | if not NULL, returns number of characters converted |
Referenced by base::FileT< size_t >::stat().
Converts a string from UTF-8 to UTF-16.
If rlen returns a number lower than len, a conversion error has occurred at postion rlen.
s | the string in UTF-8 encoding | |
rlen | if not NULL, returns number of characters converted |