Logo Search packages:      
Sourcecode: icu version File versions

utf8.h File Reference


Detailed Description

C API: UTF-8 macros.

This file defines macros to deal with UTF-8 code units and code points. Signatures and semantics are the same as for the similarly named macros in utf16.h. utf8.h is included by utf.h after unicode/umachine.h and some common definitions.

Usage: ICU coding guidelines for if() statements should be followed when using these macros. Compound statements (curly braces {}) must be used for if-else-while... bodies and all macro statements should be terminated with semicolon.

Definition in file utf8.h.

#include "unicode/utf.h"

Go to the source code of this file.

Defines

#define UTF8_APPEND_CHAR_SAFE(s, i, length, c)
#define UTF8_APPEND_CHAR_UNSAFE(s, i, c)
#define UTF8_ARRAY_SIZE(size)   ((5*(size))/2)
#define UTF8_BACK_1_SAFE(s, start, i)
#define UTF8_BACK_1_UNSAFE(s, i)
#define UTF8_BACK_N_SAFE(s, start, i, n)
#define UTF8_BACK_N_UNSAFE(s, i, n)
#define UTF8_CHAR_LENGTH(c)
#define UTF8_COUNT_TRAIL_BYTES(leadByte)   (utf8_countTrailBytes[(uint8_t)leadByte])
#define UTF8_FWD_1_SAFE(s, i, length)
#define UTF8_FWD_1_UNSAFE(s, i)
#define UTF8_FWD_N_SAFE(s, i, length, n)
#define UTF8_FWD_N_UNSAFE(s, i, n)
#define UTF8_GET_CHAR_SAFE(s, start, i, length, c, strict)
#define UTF8_GET_CHAR_UNSAFE(s, i, c)
#define UTF8_IS_LEAD(uchar)   ((uint8_t)((uchar)-0xc0)<0x3e)
#define UTF8_IS_SINGLE(uchar)   (((uchar)&0x80)==0)
#define UTF8_IS_TRAIL(uchar)   (((uchar)&0xc0)==0x80)
#define UTF8_MASK_LEAD_BYTE(leadByte, countTrailBytes)   ((leadByte)&=(1<<(6-(countTrailBytes)))-1)
#define UTF8_MAX_CHAR_LENGTH   4
#define UTF8_NEED_MULTIPLE_UCHAR(c)   ((uint32_t)(c)>0x7f)
#define UTF8_NEXT_CHAR_SAFE(s, i, length, c, strict)
#define UTF8_NEXT_CHAR_UNSAFE(s, i, c)
#define UTF8_PREV_CHAR_SAFE(s, start, i, c, strict)
#define UTF8_PREV_CHAR_UNSAFE(s, i, c)
#define UTF8_SET_CHAR_LIMIT_SAFE(s, start, i, length)
#define UTF8_SET_CHAR_LIMIT_UNSAFE(s, i)
#define UTF8_SET_CHAR_START_SAFE(s, start, i)
#define UTF8_SET_CHAR_START_UNSAFE(s, i)

Functions

U_CAPI int32_t U_EXPORT2 utf8_appendCharSafeBody (uint8_t *s, int32_t i, int32_t length, UChar32 c)
U_CAPI int32_t U_EXPORT2 utf8_back1SafeBody (const uint8_t *s, int32_t start, int32_t i)
U_CAPI UChar32 U_EXPORT2 utf8_nextCharSafeBody (const uint8_t *s, int32_t *pi, int32_t length, UChar32 c, UBool strict)
U_CAPI UChar32 U_EXPORT2 utf8_prevCharSafeBody (const uint8_t *s, int32_t start, int32_t *pi, UChar32 c, UBool strict)

Variables

U_CFUNC const uint8_t U_IMPORT utf8_countTrailBytes [256]


Generated by  Doxygen 1.6.0   Back to index