OLD | NEW |
1 /* | 1 /* |
2 ********************************************************************** | 2 ********************************************************************** |
3 * Copyright (C) 2002-2012, International Business Machines | 3 * Copyright (C) 2002-2015, International Business Machines |
4 * Corporation and others. All Rights Reserved. | 4 * Corporation and others. All Rights Reserved. |
5 ********************************************************************** | 5 ********************************************************************** |
6 * file name: ucnv_u8.c | 6 * file name: ucnv_u8.c |
7 * encoding: US-ASCII | 7 * encoding: US-ASCII |
8 * tab size: 8 (not used) | 8 * tab size: 8 (not used) |
9 * indentation:4 | 9 * indentation:4 |
10 * | 10 * |
11 * created on: 2002jul01 | 11 * created on: 2002jul01 |
12 * created by: Markus W. Scherer | 12 * created by: Markus W. Scherer |
13 * | 13 * |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 * Starting with Unicode 3.0.1: | 82 * Starting with Unicode 3.0.1: |
83 * UTF-8 byte sequences of length N _must_ encode code points of or above utf8_m
inChar32[N]; | 83 * UTF-8 byte sequences of length N _must_ encode code points of or above utf8_m
inChar32[N]; |
84 * byte sequences with more than 4 bytes are illegal in UTF-8, | 84 * byte sequences with more than 4 bytes are illegal in UTF-8, |
85 * which is tested with impossible values for them | 85 * which is tested with impossible values for them |
86 */ | 86 */ |
87 static const uint32_t | 87 static const uint32_t |
88 utf8_minChar32[7]={ 0, 0, 0x80, 0x800, 0x10000, 0xffffffff, 0xffffffff }; | 88 utf8_minChar32[7]={ 0, 0, 0x80, 0x800, 0x10000, 0xffffffff, 0xffffffff }; |
89 | 89 |
90 static UBool hasCESU8Data(const UConverter *cnv) | 90 static UBool hasCESU8Data(const UConverter *cnv) |
91 { | 91 { |
92 #if UCONFIG_NO_NON_HTML5_CONVERSION | 92 #if UCONFIG_ONLY_HTML_CONVERSION |
93 return FALSE; | 93 return FALSE; |
94 #else | 94 #else |
95 return (UBool)(cnv->sharedData == &_CESU8Data); | 95 return (UBool)(cnv->sharedData == &_CESU8Data); |
96 #endif | 96 #endif |
97 } | 97 } |
98 | 98 |
99 static void ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args, | 99 static void ucnv_toUnicode_UTF8 (UConverterToUnicodeArgs * args, |
100 UErrorCode * err) | 100 UErrorCode * err) |
101 { | 101 { |
102 UConverter *cnv = args->converter; | 102 UConverter *cnv = args->converter; |
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 0, | 1080 0, |
1081 0, | 1081 0, |
1082 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */ | 1082 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } /* reserved */ |
1083 }; | 1083 }; |
1084 | 1084 |
1085 | 1085 |
1086 const UConverterSharedData _CESU8Data= | 1086 const UConverterSharedData _CESU8Data= |
1087 UCNV_IMMUTABLE_SHARED_DATA_INITIALIZER(&_CESU8StaticData, &_CESU8Impl); | 1087 UCNV_IMMUTABLE_SHARED_DATA_INITIALIZER(&_CESU8StaticData, &_CESU8Impl); |
1088 | 1088 |
1089 #endif | 1089 #endif |
OLD | NEW |