2
#ifndef _PARSER_UNICODE_H_
3
#define _PARSER_UNICODE_H_
7
typedef unsigned long UTF32; /* at least 32 bits */
8
typedef unsigned short UTF16; /* at least 16 bits */
9
typedef unsigned char UTF8; /* typically 8 bits */
11
#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
12
#define UNI_MAX_BMP (UTF32)0x0000FFFF
13
#define UNI_MAX_UTF16 (UTF32)0x0010FFFF
14
#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
15
#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
17
#define UNI_SUR_HIGH_START (UTF32)0xD800
18
#define UNI_SUR_HIGH_END (UTF32)0xDBFF
19
#define UNI_SUR_LOW_START (UTF32)0xDC00
20
#define UNI_SUR_LOW_END (UTF32)0xDFFF
22
static const int halfShift = 10; /* used for shifting by 10 bits */
24
static const UTF32 halfBase = 0x0010000UL;
25
static const UTF32 halfMask = 0x3FFUL;
28
conversionOK = 0, /* conversion successful */
29
sourceExhausted, /* partial character in source, but hit end */
30
targetExhausted, /* insuff. room in target for conversion */
31
sourceIllegal /* source sequence is illegal/malformed */
39
char *JSON_convert_UTF16_to_UTF8 (
43
ConversionFlags flags);
46
#define RARRAY_PTR(ARRAY) RARRAY(ARRAY)->ptr
49
#define RARRAY_LEN(ARRAY) RARRAY(ARRAY)->len
52
#define RSTRING_PTR(string) RSTRING(string)->ptr
55
#define RSTRING_LEN(string) RSTRING(string)->len