HTML Tidy 5.8.0
The HTACG Tidy HTML Project
 
Loading...
Searching...
No Matches
utf8.h
Go to the documentation of this file.
1#ifndef __UTF8_H__
2#define __UTF8_H__
3
4/* utf8.h -- convert characters to/from UTF-8
5
6 (c) 1998-2006 (W3C) MIT, ERCIM, Keio University
7 See tidy.h for the copyright notice.
8
9*/
10
11#include "tidyplatform.h"
12#include "tidybuffio.h"
13
14/* UTF-8 encoding/decoding support
15** Does not convert character "codepoints", i.e. to/from 10646.
16*/
17
18TY_PRIVATE int TY_(DecodeUTF8BytesToChar)( uint* c, uint firstByte, ctmbstr successorBytes,
19 TidyInputSource* inp, int* count );
20
21TY_PRIVATE int TY_(EncodeCharToUTF8Bytes)( uint c, tmbstr encodebuf,
22 TidyOutputSink* outp, int* count );
23
24
25TY_PRIVATE uint TY_(GetUTF8)( ctmbstr str, uint *ch );
26TY_PRIVATE tmbstr TY_(PutUTF8)( tmbstr buf, uint c );
27
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 */
32
33
34TY_PRIVATE Bool TY_(IsValidUTF16FromUCS4)( tchar ucs4 );
35TY_PRIVATE Bool TY_(IsHighSurrogate)( tchar ch );
36TY_PRIVATE Bool TY_(IsLowSurrogate)( tchar ch );
37
38TY_PRIVATE Bool TY_(IsCombinedChar)( tchar ch );
39TY_PRIVATE Bool TY_(IsValidCombinedChar)( tchar ch );
40
41TY_PRIVATE tchar TY_(CombineSurrogatePair)( tchar high, tchar low );
42TY_PRIVATE Bool TY_(SplitSurrogatePair)( tchar utf16, tchar* high, tchar* low );
43
44
45
46#endif /* __UTF8_H__ */
#define TY_PRIVATE
Definition forward.h:29
#define TY_(str)
Definition forward.h:23
This type defines an input source capable of delivering raw bytes of input.
Definition tidy.h:1079
This type defines an output destination capable of accepting raw bytes of output.
Definition tidy.h:1129
Treat buffer as a stream that Tidy can use for I/O operations.
Platform specific definitions, specifics, and headers.
Bool
Definition tidyplatform.h:647
uint tchar
Definition tidyplatform.h:605
unsigned int uint
Definition tidyplatform.h:569
const tmbchar * ctmbstr
Definition tidyplatform.h:609
tmbchar * tmbstr
Definition tidyplatform.h:608