Go to the documentation of this file.
38 #ifndef BLOCXX_UTF8_UTILS_HPP_INCLUDE_GUARD_
39 #define BLOCXX_UTF8_UTILS_HPP_INCLUDE_GUARD_
40 #include "blocxx/BLOCXX_config.h"
60 BLOCXX_COMMON_API
size_t charCount(
const char* utf8str);
68 BLOCXX_COMMON_API UInt16
UTF8toUCS2(
const char* utf8char);
74 BLOCXX_COMMON_API String
UCS2toUTF8(UInt16 ucs2char);
81 BLOCXX_COMMON_API UInt32
UTF8toUCS4(
const char* utf8char);
87 BLOCXX_COMMON_API String
UCS4toUTF8(UInt32 ucs4char);
95 BLOCXX_COMMON_API
void UCS4toUTF8(UInt32 ucs4char, StringBuffer& sb);
112 BLOCXX_COMMON_API Array<UInt16>
StringToUCS2(
const String& input);
127 BLOCXX_COMMON_API String
UCS2ToString(
const Array<UInt16>& input);
133 BLOCXX_COMMON_API String
UCS2ToString(
const Array<char>& input);
140 BLOCXX_COMMON_API String
UCS2ToString(
const void* input,
size_t inputLength);
157 BLOCXX_COMMON_API String
toUpperCase(
const char* input);
174 BLOCXX_COMMON_API String
toLowerCase(
const char* input);
bool toLowerCaseInPlace(char *input)
Convert the UTF-8 string to lower case.
String toLowerCase(const char *input)
Convert the UTF-8 string to lower case and return the result.
String UCS2ToString(const void *input, size_t inputLength)
Convert a UCS2 string into a UTF-8 (or ASCII) string.
BLOCXX_COMMON_API int compareToIgnoreCase(const char *str1, const char *str2)
Compares 2 UTF-8 strings, ignoring any case differences as defined by the Unicode spec CaseFolding....
size_t charCount(const char *utf8str)
Count the number of UTF-8 chars in the string.
Array< UInt16 > StringToUCS2(const String &input)
Convert a UTF-8 (or ASCII) string into a UCS2 string.
#define BLOCXX_DECLARE_APIEXCEPTION(NAME, LINKAGE_SPEC)
Declare a new exception class named <NAME>Exception that derives from Exception This macro is typical...
UInt16 UTF8toUCS2(const char *utf8char)
Convert one UTF-8 char (possibly multiple bytes) into a UCS2 16-bit char.
Array< UInt16 > StringToUCS2ReplaceInvalid(const String &input)
Convert a UTF-8 (or ASCII) string into a UCS2 string.
String UCS2toUTF8(UInt16 ucs2char)
Convert one UCS2 16-bit char into a UTF-8 char (possibly multiple bytes)
String UCS4toUTF8(UInt32 ucs4char)
Convert one UCS4 32-bit char into a UTF-8 char (possibly multiple bytes)
bool toUpperCaseInPlace(char *input)
Convert the UTF-8 string to upper case.
String toUpperCase(const char *input)
Convert the UTF-8 string to upper case and return the result.
UInt32 UTF8toUCS4(const char *utf8char)
Convert one UTF-8 char (possibly multiple bytes) into a UCS4 32-bit char.