NIM 跨平台 C++ SDK
载入中...
搜索中...
未找到
convert_utf.c 文件参考

宏定义

#define UNI_SUR_HIGH_START   (UTF32)0xD800
 
#define UNI_SUR_HIGH_END   (UTF32)0xDBFF
 
#define UNI_SUR_LOW_START   (UTF32)0xDC00
 
#define UNI_SUR_LOW_END   (UTF32)0xDFFF
 
#define false   0
 
#define true   1
 

函数

ConversionResult ConvertUTF32toUTF16 (const UTF32 **sourceStart, const UTF32 *sourceEnd, UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF16toUTF32 (const UTF16 **sourceStart, const UTF16 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF16toUTF8 (const UTF16 **sourceStart, const UTF16 *sourceEnd, UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags)
 
static Boolean isLegalUTF8 (const UTF8 *source, int length)
 
Boolean isLegalUTF8Sequence (const UTF8 *source, const UTF8 *sourceEnd)
 
ConversionResult ConvertUTF8toUTF16 (const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF32toUTF8 (const UTF32 **sourceStart, const UTF32 *sourceEnd, UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF8toUTF32 (const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags)
 

变量

static const int halfShift = 10
 
static const UTF32 halfBase = 0x0010000UL
 
static const UTF32 halfMask = 0x3FFUL
 
static const char trailingBytesForUTF8 [256]
 
static const UTF32 offsetsFromUTF8 [6] = {0x00000000UL, 0x00003080UL, 0x000E2080UL, 0x03C82080UL, 0xFA082080UL, 0x82082080UL}
 
static const UTF8 firstByteMark [7] = {0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC}
 

宏定义说明

◆ false

#define false   0

◆ true

#define true   1

◆ UNI_SUR_HIGH_END

#define UNI_SUR_HIGH_END   (UTF32)0xDBFF

◆ UNI_SUR_HIGH_START

#define UNI_SUR_HIGH_START   (UTF32)0xD800

◆ UNI_SUR_LOW_END

#define UNI_SUR_LOW_END   (UTF32)0xDFFF

◆ UNI_SUR_LOW_START

#define UNI_SUR_LOW_START   (UTF32)0xDC00

函数说明

◆ ConvertUTF16toUTF32()

ConversionResult ConvertUTF16toUTF32 ( const UTF16 ** sourceStart,
const UTF16 * sourceEnd,
UTF32 ** targetStart,
UTF32 * targetEnd,
ConversionFlags flags )

◆ ConvertUTF16toUTF8()

ConversionResult ConvertUTF16toUTF8 ( const UTF16 ** sourceStart,
const UTF16 * sourceEnd,
UTF8 ** targetStart,
UTF8 * targetEnd,
ConversionFlags flags )

◆ ConvertUTF32toUTF16()

ConversionResult ConvertUTF32toUTF16 ( const UTF32 ** sourceStart,
const UTF32 * sourceEnd,
UTF16 ** targetStart,
UTF16 * targetEnd,
ConversionFlags flags )

◆ ConvertUTF32toUTF8()

ConversionResult ConvertUTF32toUTF8 ( const UTF32 ** sourceStart,
const UTF32 * sourceEnd,
UTF8 ** targetStart,
UTF8 * targetEnd,
ConversionFlags flags )

◆ ConvertUTF8toUTF16()

ConversionResult ConvertUTF8toUTF16 ( const UTF8 ** sourceStart,
const UTF8 * sourceEnd,
UTF16 ** targetStart,
UTF16 * targetEnd,
ConversionFlags flags )

◆ ConvertUTF8toUTF32()

ConversionResult ConvertUTF8toUTF32 ( const UTF8 ** sourceStart,
const UTF8 * sourceEnd,
UTF32 ** targetStart,
UTF32 * targetEnd,
ConversionFlags flags )

◆ isLegalUTF8()

static Boolean isLegalUTF8 ( const UTF8 * source,
int length )
static

◆ isLegalUTF8Sequence()

Boolean isLegalUTF8Sequence ( const UTF8 * source,
const UTF8 * sourceEnd )

变量说明

◆ firstByteMark

const UTF8 firstByteMark[7] = {0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF8, 0xFC}
static

◆ halfBase

const UTF32 halfBase = 0x0010000UL
static

◆ halfMask

const UTF32 halfMask = 0x3FFUL
static

◆ halfShift

const int halfShift = 10
static

◆ offsetsFromUTF8

const UTF32 offsetsFromUTF8[6] = {0x00000000UL, 0x00003080UL, 0x000E2080UL, 0x03C82080UL, 0xFA082080UL, 0x82082080UL}
static

◆ trailingBytesForUTF8

const char trailingBytesForUTF8[256]
static
初始值:
= {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5}