4 /* utf8.h -- convert characters to/from UTF-8
6 (c) 1998-2006 (W3C) MIT, ERCIM, Keio University
7 See tidy.h for the copyright notice.
14 /* UTF-8 encoding/decoding support
15 ** Does not convert character "codepoints", i.e. to/from 10646.
18 int TY_(DecodeUTF8BytesToChar)( uint* c, uint firstByte, ctmbstr successorBytes,
19 TidyInputSource* inp, int* count );
21 int TY_(EncodeCharToUTF8Bytes)( uint c, tmbstr encodebuf,
22 TidyOutputSink* outp, int* count );
25 uint TY_(GetUTF8)( ctmbstr str, uint *ch );
26 tmbstr TY_(PutUTF8)( tmbstr buf, uint c );
28 #define UNICODE_BOM_BE 0xFEFF /* big-endian (default) UNICODE BOM */
29 #define UNICODE_BOM UNICODE_BOM_BE
30 #define UNICODE_BOM_LE 0xFFFE /* little-endian UNICODE BOM */
31 #define UNICODE_BOM_UTF8 0xEFBBBF /* UTF-8 UNICODE BOM */
34 Bool TY_(IsValidUTF16FromUCS4)( tchar ucs4 );
35 Bool TY_(IsHighSurrogate)( tchar ch );
36 Bool TY_(IsLowSurrogate)( tchar ch );
38 Bool TY_(IsCombinedChar)( tchar ch );
39 Bool TY_(IsValidCombinedChar)( tchar ch );
41 tchar TY_(CombineSurrogatePair)( tchar high, tchar low );
42 Bool TY_(SplitSurrogatePair)( tchar utf16, tchar* high, tchar* low );
46 #endif /* __UTF8_H__ */