32 #define UTF16_IS_SURROGATE_FIRST(c) (((c) & 0xfc) == 0xd8)
33 #define UTF16_IS_SURROGATE_SECOND(c) (((c) & 0xfc) == 0xdc)
34 #define UTF16_IS_SURROGATE(c) (((c) & 0xf8) == 0xd8)
37 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
38 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
39 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
40 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
41 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
42 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
43 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
44 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
45 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
46 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
47 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
48 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
49 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
50 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 2, 2, 2, 2,
51 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
52 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2
59 int len = (int)(e - p);
81 if (*p == 0x0a && *(p+1) == 0x00)
83 #ifdef USE_UNICODE_ALL_LINE_TERMINATORS
85 #ifndef USE_CRNL_AS_LINE_TERMINATOR
88 *p == 0x85) && *(p+1) == 0x00)
90 if (*(p+1) == 0x20 && (*p == 0x29 || *p == 0x28))
106 code = ((((c1 << 8) + c0) & 0x03ff) << 10)
107 + (((p[3] << 8) + p[2]) & 0x03ff) + 0x10000;
110 code = c1 * 256 + p[0];
119 return (code > 0xffff ? 4 : 2);
129 unsigned int high = (code >> 10) + 0xD7C0;
130 unsigned int low = (code & 0x3FF) + 0xDC00;
132 *p++ = (high >> 8) & 0xFF;
134 *p++ = (low >> 8) & 0xFF;
138 *p++ = (
UChar )(code & 0xff);
139 *p++ = (
UChar )((code & 0xff00) >> 8);
152 #ifdef USE_UNICODE_CASE_FOLD_TURKISH_AZERI
190 v = ONIGENC_IS_UNICODE_ISO_8859_1_BIT_CTYPE(c,
194 if (c >= 0xaa && c <= 0xba)
210 if (s <= start)
return (
UChar* )s;
212 if ((s - start) % 2 == 1) {
229 flag, p, end, items);
int onigenc_unicode_is_code_ctype(OnigCodePoint code, unsigned int ctype, OnigEncoding enc ARG_UNUSED)
unsigned int OnigCodePoint
static UChar * utf16le_left_adjust_char_head(const UChar *start, const UChar *s, const UChar *end, OnigEncoding enc ARG_UNUSED)
unsigned int OnigCaseFoldType
#define ONIGENC_IS_ASCII_CODE(code)
int onigenc_unicode_property_name_to_ctype(OnigEncoding enc, UChar *name, UChar *end)
#define UTF16_IS_SURROGATE_SECOND(c)
static const int EncLen_UTF16[]
static OnigCodePoint utf16le_mbc_to_code(const UChar *p, const UChar *end ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
int onigenc_unicode_mbc_case_fold(OnigEncoding enc, OnigCaseFoldType flag ARG_UNUSED, const UChar **pp, const UChar *end, UChar *fold)
static int utf16le_get_case_fold_codes_by_str(OnigCaseFoldType flag, const OnigUChar *p, const OnigUChar *end, OnigCaseFoldCodeItem items[], OnigEncoding enc)
OnigEncodingDefine(utf_16le, UTF_16LE)
int onigenc_always_false_is_allowed_reverse_match(const UChar *s ARG_UNUSED, const UChar *end ARG_UNUSED, OnigEncoding enc ARG_UNUSED)
static int utf16le_is_mbc_newline(const UChar *p, const UChar *end, OnigEncoding enc ARG_UNUSED)
static int utf16le_mbc_case_fold(OnigCaseFoldType flag, const UChar **pp, const UChar *end, UChar *fold, OnigEncoding enc)
int onigenc_unicode_apply_all_case_fold(OnigCaseFoldType flag, OnigApplyAllCaseFoldFunc f, void *arg, OnigEncoding enc ARG_UNUSED)
#define ONIGENC_CONSTRUCT_MBCLEN_NEEDMORE(n)
#define ONIGENC_CASE_FOLD_TURKISH_AZERI
unsigned char buf[MIME_BUF_SIZE]
#define ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND(n)
register unsigned int len
#define UTF16_IS_SURROGATE(c)
#define ONIGENC_CONSTRUCT_MBCLEN_INVALID()
static int utf16le_code_to_mbclen(OnigCodePoint code, OnigEncoding enc ARG_UNUSED)
int onigenc_unicode_get_case_fold_codes_by_str(OnigEncoding enc, OnigCaseFoldType flag, const OnigUChar *p, const OnigUChar *end, OnigCaseFoldCodeItem items[])
#define ONIGENC_ASCII_CODE_TO_LOWER_CASE(c)
#define UTF16_IS_SURROGATE_FIRST(c)
#define INTERNAL_ONIGENC_CASE_FOLD_MULTI_CHAR
static int utf16le_mbc_enc_len(const UChar *p, const OnigUChar *e, OnigEncoding enc ARG_UNUSED)
int onigenc_utf16_32_get_ctype_code_range(OnigCtype ctype, OnigCodePoint *sb_out, const OnigCodePoint *ranges[], struct OnigEncodingTypeST *enc ARG_UNUSED)
static int utf16le_code_to_mbc(OnigCodePoint code, UChar *buf, OnigEncoding enc ARG_UNUSED)