Static Public Member Functions

UT_Unicode Class Reference

contain various unicode function. More...

#include <ut_unicode.h>

List of all members.

Static Public Member Functions

static UT_UCS4Char UTF8_to_UCS4 (const char *&buffer, size_t &length)
 scans a buffer for the next valid UTF-8 sequence and returns the corresponding UCS-4 value for that sequence; the pointer and length-remaining are incremented and decremented respectively; returns 0 if no valid UTF-8 sequence found by the end of the string
static int UTF8_ByteLength (UT_UCS4Char ucs4)
 Returns -1 if ucs4 is not valid UCS-4, 0 if ucs4 is 0, 1-6 otherwise.
static bool UCS4_to_UTF8 (char *&buffer, size_t &length, UT_UCS4Char ucs4)
 appends to the buffer the UTF-8 sequence corresponding to the UCS-4 value; the pointer and length-remaining are incremented and decremented respectively; returns false if not valid UCS-4 or if (length < UTF8_ByteLength (ucs4))

Detailed Description

contain various unicode function.

Just a namespace


Member Function Documentation

bool UT_Unicode::UCS4_to_UTF8 ( char *&  buffer,
size_t &  length,
UT_UCS4Char  ucs4 
) [static]

appends to the buffer the UTF-8 sequence corresponding to the UCS-4 value; the pointer and length-remaining are incremented and decremented respectively; returns false if not valid UCS-4 or if (length < UTF8_ByteLength (ucs4))

References gchar.

Referenced by UT_UTF8Stringbuf::appendUCS2(), UT_UTF8Stringbuf::appendUCS4(), UT_UTF8Stringbuf::decodeURL(), and UT_StringImpl< UT_UCS4Char >::utf8_data().

int UT_Unicode::UTF8_ByteLength ( UT_UCS4Char  ucs4  )  [static]

Returns -1 if ucs4 is not valid UCS-4, 0 if ucs4 is 0, 1-6 otherwise.

Referenced by UT_UTF8Stringbuf::appendUCS2(), UT_UTF8Stringbuf::appendUCS4(), and UT_StringImpl< UT_UCS4Char >::utf8_data().

UT_UCS4Char UT_Unicode::UTF8_to_UCS4 ( const char *&  buffer,
size_t &  length 
) [static]

scans a buffer for the next valid UTF-8 sequence and returns the corresponding UCS-4 value for that sequence; the pointer and length-remaining are incremented and decremented respectively; returns 0 if no valid UTF-8 sequence found by the end of the string

Referenced by UT_UCS4String::_loadUtf8(), BarbarismChecker::startElement(), UT_UTF8String::ucs4_str(), UT_UCS4String::UT_UCS4String(), and UT_UTF8_Base64Decode().


The documentation for this class was generated from the following files: