blocxx
UTF8Utils.cpp File Reference
#include "blocxx/BLOCXX_config.h"
#include "blocxx/UTF8Utils.hpp"
#include "blocxx/String.hpp"
#include "blocxx/Assertion.hpp"
#include "blocxx/Array.hpp"
#include "blocxx/Format.hpp"
#include "blocxx/ExceptionIds.hpp"
#include <string.h>
#include <algorithm>

Go to the source code of this file.

Namespaces

namespace  BLOCXX_NAMESPACE
 Taken from RFC 1321.
 
namespace  BLOCXX_NAMESPACE::UTF8Utils
 

Functions

size_t BLOCXX_NAMESPACE::UTF8Utils::charCount (const char *utf8str)
 Count the number of UTF-8 chars in the string.
 
UInt16 BLOCXX_NAMESPACE::UTF8Utils::UTF8toUCS2 (const char *utf8char)
 Convert one UTF-8 char (possibly multiple bytes) into a UCS2 16-bit char.
 
String BLOCXX_NAMESPACE::UTF8Utils::UCS2toUTF8 (UInt16 ucs2char)
 Convert one UCS2 16-bit char into a UTF-8 char (possibly multiple bytes)
 
UInt32 BLOCXX_NAMESPACE::UTF8Utils::UTF8toUCS4 (const char *utf8char)
 Convert one UTF-8 char (possibly multiple bytes) into a UCS4 32-bit char.
 
String BLOCXX_NAMESPACE::UTF8Utils::UCS4toUTF8 (UInt32 ucs4char)
 Convert one UCS4 32-bit char into a UTF-8 char (possibly multiple bytes)
 
void BLOCXX_NAMESPACE::UTF8Utils::UCS4toUTF8 (UInt32 ucs4char, StringBuffer &sb)
 Convert one UCS4 32-bit char into a UTF-8 char (possibly multiple bytes) This version is faster to use in a loop than the version which returns a String.
 
Array< UInt16 > BLOCXX_NAMESPACE::UTF8Utils::StringToUCS2ReplaceInvalid (const String &input)
 Convert a UTF-8 (or ASCII) string into a UCS2 string.
 
Array< UInt16 > BLOCXX_NAMESPACE::UTF8Utils::StringToUCS2 (const String &input)
 Convert a UTF-8 (or ASCII) string into a UCS2 string.
 
String BLOCXX_NAMESPACE::UTF8Utils::UCS2ToString (const void *input, size_t inputLength)
 Convert a UCS2 string into a UTF-8 (or ASCII) string.
 
String BLOCXX_NAMESPACE::UTF8Utils::UCS2ToString (const Array< UInt16 > &input)
 Convert a UCS2 string into a UTF-8 (or ASCII) string.
 
String BLOCXX_NAMESPACE::UTF8Utils::UCS2ToString (const Array< char > &input)
 Convert a UCS2 string into a UTF-8 (or ASCII) string.
 
bool BLOCXX_NAMESPACE::UTF8Utils::toUpperCaseInPlace (char *input)
 Convert the UTF-8 string to upper case.
 
String BLOCXX_NAMESPACE::UTF8Utils::toUpperCase (const char *input)
 Convert the UTF-8 string to upper case and return the result.
 
bool BLOCXX_NAMESPACE::UTF8Utils::toLowerCaseInPlace (char *input)
 Convert the UTF-8 string to lower case.
 
String BLOCXX_NAMESPACE::UTF8Utils::toLowerCase (const char *input)
 Convert the UTF-8 string to lower case and return the result.