ICU 57.1 57.1
utf.h
Go to the documentation of this file.
1/*
2*******************************************************************************
3*
4* Copyright (C) 1999-2011, International Business Machines
5* Corporation and others. All Rights Reserved.
6*
7*******************************************************************************
8* file name: utf.h
9* encoding: US-ASCII
10* tab size: 8 (not used)
11* indentation:4
12*
13* created on: 1999sep09
14* created by: Markus W. Scherer
15*/
16
111#ifndef __UTF_H__
112#define __UTF_H__
113
114#include "unicode/umachine.h"
115/* include the utfXX.h after the following definitions */
116
117/* single-code point definitions -------------------------------------------- */
118
125#define U_IS_UNICODE_NONCHAR(c) \
126 ((c)>=0xfdd0 && \
127 ((uint32_t)(c)<=0xfdef || ((c)&0xfffe)==0xfffe) && \
128 (uint32_t)(c)<=0x10ffff)
129
147#define U_IS_UNICODE_CHAR(c) \
148 ((uint32_t)(c)<0xd800 || \
149 ((uint32_t)(c)>0xdfff && \
150 (uint32_t)(c)<=0x10ffff && \
151 !U_IS_UNICODE_NONCHAR(c)))
152
159#define U_IS_BMP(c) ((uint32_t)(c)<=0xffff)
160
167#define U_IS_SUPPLEMENTARY(c) ((uint32_t)((c)-0x10000)<=0xfffff)
168
175#define U_IS_LEAD(c) (((c)&0xfffffc00)==0xd800)
176
183#define U_IS_TRAIL(c) (((c)&0xfffffc00)==0xdc00)
184
191#define U_IS_SURROGATE(c) (((c)&0xfffff800)==0xd800)
192
200#define U_IS_SURROGATE_LEAD(c) (((c)&0x400)==0)
201
209#define U_IS_SURROGATE_TRAIL(c) (((c)&0x400)!=0)
210
211/* include the utfXX.h ------------------------------------------------------ */
212
213#if !U_NO_DEFAULT_INCLUDE_UTF_HEADERS
214
215#include "unicode/utf8.h"
216#include "unicode/utf16.h"
217
218/* utf_old.h contains deprecated, pre-ICU 2.4 definitions */
219#include "unicode/utf_old.h"
220
221#endif /* !U_NO_DEFAULT_INCLUDE_UTF_HEADERS */
222
223#endif /* __UTF_H__ */
Basic types and constants for UTF.
C API: 16-bit Unicode handling macros.
C API: 8-bit Unicode handling macros.
C API: Deprecated macros for Unicode string handling.