]> git.saurik.com Git - apple/icu.git/blob - icuSources/common/ucnvhz.c
ICU-400.38.tar.gz
[apple/icu.git] / icuSources / common / ucnvhz.c
1 /*
2 **********************************************************************
3 * Copyright (C) 2000-2008, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 * file name: ucnvhz.c
7 * encoding: US-ASCII
8 * tab size: 8 (not used)
9 * indentation:4
10 *
11 * created on: 2000oct16
12 * created by: Ram Viswanadha
13 * 10/31/2000 Ram Implemented offsets logic function
14 *
15 */
16
17 #include "unicode/utypes.h"
18
19 #if !UCONFIG_NO_CONVERSION && !UCONFIG_NO_LEGACY_CONVERSION
20
21 #include "cmemory.h"
22 #include "unicode/ucnv.h"
23 #include "unicode/ucnv_cb.h"
24 #include "unicode/uset.h"
25 #include "ucnv_bld.h"
26 #include "ucnv_cnv.h"
27
28 #define UCNV_TILDE 0x7E /* ~ */
29 #define UCNV_OPEN_BRACE 0x7B /* { */
30 #define UCNV_CLOSE_BRACE 0x7D /* } */
31 #define SB_ESCAPE "\x7E\x7D"
32 #define DB_ESCAPE "\x7E\x7B"
33 #define TILDE_ESCAPE "\x7E\x7E"
34 #define ESC_LEN 2
35
36
37 #define CONCAT_ESCAPE_MACRO( args, targetIndex,targetLength,strToAppend, err, len,sourceIndex){ \
38 while(len-->0){ \
39 if(targetIndex < targetLength){ \
40 args->target[targetIndex] = (unsigned char) *strToAppend; \
41 if(args->offsets!=NULL){ \
42 *(offsets++) = sourceIndex-1; \
43 } \
44 targetIndex++; \
45 } \
46 else{ \
47 args->converter->charErrorBuffer[(int)args->converter->charErrorBufferLength++] = (unsigned char) *strToAppend; \
48 *err =U_BUFFER_OVERFLOW_ERROR; \
49 } \
50 strToAppend++; \
51 } \
52 }
53
54
55 typedef struct{
56 UConverter* gbConverter;
57 int32_t targetIndex;
58 int32_t sourceIndex;
59 UBool isEscapeAppended;
60 UBool isStateDBCS;
61 UBool isTargetUCharDBCS;
62 UBool isEmptySegment;
63 }UConverterDataHZ;
64
65
66
67 static void
68 _HZOpen(UConverter *cnv, const char *name,const char *locale,uint32_t options, UErrorCode *errorCode){
69 cnv->toUnicodeStatus = 0;
70 cnv->fromUnicodeStatus= 0;
71 cnv->mode=0;
72 cnv->fromUChar32=0x0000;
73 cnv->extraInfo = uprv_malloc(sizeof(UConverterDataHZ));
74 if(cnv->extraInfo != NULL){
75 uprv_memset(cnv->extraInfo, 0, sizeof(UConverterDataHZ));
76 ((UConverterDataHZ*)cnv->extraInfo)->gbConverter = ucnv_open("GBK",errorCode);
77 }
78 else {
79 *errorCode = U_MEMORY_ALLOCATION_ERROR;
80 return;
81 }
82 }
83
84 static void
85 _HZClose(UConverter *cnv){
86 if(cnv->extraInfo != NULL) {
87 ucnv_close (((UConverterDataHZ *) (cnv->extraInfo))->gbConverter);
88 if(!cnv->isExtraLocal) {
89 uprv_free(cnv->extraInfo);
90 }
91 cnv->extraInfo = NULL;
92 }
93 }
94
95 static void
96 _HZReset(UConverter *cnv, UConverterResetChoice choice){
97 if(choice<=UCNV_RESET_TO_UNICODE) {
98 cnv->toUnicodeStatus = 0;
99 cnv->mode=0;
100 if(cnv->extraInfo != NULL){
101 ((UConverterDataHZ*)cnv->extraInfo)->isStateDBCS = FALSE;
102 ((UConverterDataHZ*)cnv->extraInfo)->isEmptySegment = FALSE;
103 }
104 }
105 if(choice!=UCNV_RESET_TO_UNICODE) {
106 cnv->fromUnicodeStatus= 0;
107 cnv->fromUChar32=0x0000;
108 if(cnv->extraInfo != NULL){
109 ((UConverterDataHZ*)cnv->extraInfo)->isEscapeAppended = FALSE;
110 ((UConverterDataHZ*)cnv->extraInfo)->targetIndex = 0;
111 ((UConverterDataHZ*)cnv->extraInfo)->sourceIndex = 0;
112 ((UConverterDataHZ*)cnv->extraInfo)->isTargetUCharDBCS = FALSE;
113 }
114 }
115 }
116
117 /**************************************HZ Encoding*************************************************
118 * Rules for HZ encoding
119 *
120 * In ASCII mode, a byte is interpreted as an ASCII character, unless a
121 * '~' is encountered. The character '~' is an escape character. By
122 * convention, it must be immediately followed ONLY by '~', '{' or '\n'
123 * (<LF>), with the following special meaning.
124
125 * 1. The escape sequence '~~' is interpreted as a '~'.
126 * 2. The escape-to-GB sequence '~{' switches the mode from ASCII to GB.
127 * 3. The escape sequence '~\n' is a line-continuation marker to be
128 * consumed with no output produced.
129 * In GB mode, characters are interpreted two bytes at a time as (pure)
130 * GB codes until the escape-from-GB code '~}' is read. This code
131 * switches the mode from GB back to ASCII. (Note that the escape-
132 * from-GB code '~}' ($7E7D) is outside the defined GB range.)
133 *
134 * Source: RFC 1842
135 *
136 * Note that the formal syntax in RFC 1842 is invalid. I assume that the
137 * intended definition of single-byte-segment is as follows (pedberg):
138 * single-byte-segment = single-byte-seq 1*single-byte-char
139 */
140
141
142 static void
143 UConverter_toUnicode_HZ_OFFSETS_LOGIC(UConverterToUnicodeArgs *args,
144 UErrorCode* err){
145 char tempBuf[2];
146 const char *mySource = ( char *) args->source;
147 UChar *myTarget = args->target;
148 const char *mySourceLimit = args->sourceLimit;
149 UChar32 targetUniChar = 0x0000;
150 int32_t mySourceChar = 0x0000;
151 UConverterDataHZ* myData=(UConverterDataHZ*)(args->converter->extraInfo);
152 tempBuf[0]=0;
153 tempBuf[1]=0;
154
155 /* Calling code already handles this situation. */
156 /*if ((args->converter == NULL) || (args->targetLimit < args->target) || (mySourceLimit < args->source)){
157 *err = U_ILLEGAL_ARGUMENT_ERROR;
158 return;
159 }*/
160
161 while(mySource< mySourceLimit){
162
163 if(myTarget < args->targetLimit){
164
165 mySourceChar= (unsigned char) *mySource++;
166
167 if(args->converter->mode == UCNV_TILDE) {
168 /* second byte after ~ */
169 args->converter->mode=0;
170 switch(mySourceChar) {
171 case 0x0A:
172 /* no output for ~\n (line-continuation marker) */
173 continue;
174 case UCNV_TILDE:
175 if(args->offsets) {
176 args->offsets[myTarget - args->target]=(int32_t)(mySource - args->source - 2);
177 }
178 *(myTarget++)=(UChar)mySourceChar;
179 myData->isEmptySegment = FALSE;
180 continue;
181 case UCNV_OPEN_BRACE:
182 case UCNV_CLOSE_BRACE:
183 myData->isStateDBCS = (mySourceChar == UCNV_OPEN_BRACE);
184 if (myData->isEmptySegment) {
185 myData->isEmptySegment = FALSE; /* we are handling it, reset to avoid future spurious errors */
186 *err = U_ILLEGAL_ESCAPE_SEQUENCE;
187 args->converter->toUCallbackReason = UCNV_IRREGULAR;
188 args->converter->toUBytes[0] = UCNV_TILDE;
189 args->converter->toUBytes[1] = mySourceChar;
190 args->converter->toULength = 2;
191 args->target = myTarget;
192 args->source = mySource;
193 return;
194 }
195 myData->isEmptySegment = TRUE;
196 continue;
197 default:
198 /* if the first byte is equal to TILDE and the trail byte
199 * is not a valid byte then it is an error condition
200 */
201 /*
202 * Ticket 5691: consistent illegal sequences:
203 * - We include at least the first byte in the illegal sequence.
204 * - If any of the non-initial bytes could be the start of a character,
205 * we stop the illegal sequence before the first one of those.
206 */
207 myData->isEmptySegment = FALSE; /* different error here, reset this to avoid spurious future error */
208 *err = U_ILLEGAL_ESCAPE_SEQUENCE;
209 args->converter->toUBytes[0] = UCNV_TILDE;
210 if( myData->isStateDBCS ?
211 (0x21 <= mySourceChar && mySourceChar <= 0x7e) :
212 mySourceChar <= 0x7f
213 ) {
214 /* The current byte could be the start of a character: Back it out. */
215 args->converter->toULength = 1;
216 --mySource;
217 } else {
218 /* Include the current byte in the illegal sequence. */
219 args->converter->toUBytes[1] = mySourceChar;
220 args->converter->toULength = 2;
221 }
222 args->target = myTarget;
223 args->source = mySource;
224 return;
225 }
226 } else if(myData->isStateDBCS) {
227 if(args->converter->toUnicodeStatus == 0x00){
228 /* lead byte */
229 if(mySourceChar == UCNV_TILDE) {
230 args->converter->mode = UCNV_TILDE;
231 } else {
232 /* add another bit to distinguish a 0 byte from not having seen a lead byte */
233 args->converter->toUnicodeStatus = (uint32_t) (mySourceChar | 0x100);
234 myData->isEmptySegment = FALSE; /* the segment has something, either valid or will produce a different error, so reset this */
235 }
236 continue;
237 }
238 else{
239 /* trail byte */
240 int leadIsOk, trailIsOk;
241 uint32_t leadByte = args->converter->toUnicodeStatus & 0xff;
242 targetUniChar = 0xffff;
243 /*
244 * Ticket 5691: consistent illegal sequences:
245 * - We include at least the first byte in the illegal sequence.
246 * - If any of the non-initial bytes could be the start of a character,
247 * we stop the illegal sequence before the first one of those.
248 *
249 * In HZ DBCS, if the second byte is in the 21..7e range,
250 * we report only the first byte as the illegal sequence.
251 * Otherwise we convert or report the pair of bytes.
252 */
253 leadIsOk = (uint8_t)(leadByte - 0x21) <= (0x7d - 0x21);
254 trailIsOk = (uint8_t)(mySourceChar - 0x21) <= (0x7e - 0x21);
255 if (leadIsOk && trailIsOk) {
256 tempBuf[0] = (char) (leadByte+0x80) ;
257 tempBuf[1] = (char) (mySourceChar+0x80);
258 targetUniChar = ucnv_MBCSSimpleGetNextUChar(myData->gbConverter->sharedData,
259 tempBuf, 2, args->converter->useFallback);
260 mySourceChar= (leadByte << 8) | mySourceChar;
261 } else if (trailIsOk) {
262 /* report a single illegal byte and continue with the following DBCS starter byte */
263 --mySource;
264 mySourceChar = (int32_t)leadByte;
265 } else {
266 /* report a pair of illegal bytes if the second byte is not a DBCS starter */
267 /* add another bit so that the code below writes 2 bytes in case of error */
268 mySourceChar= 0x10000 | (leadByte << 8) | mySourceChar;
269 }
270 args->converter->toUnicodeStatus =0x00;
271 }
272 }
273 else{
274 if(mySourceChar == UCNV_TILDE) {
275 args->converter->mode = UCNV_TILDE;
276 continue;
277 } else if(mySourceChar <= 0x7f) {
278 targetUniChar = (UChar)mySourceChar; /* ASCII */
279 myData->isEmptySegment = FALSE; /* the segment has something valid */
280 } else {
281 targetUniChar = 0xffff;
282 myData->isEmptySegment = FALSE; /* different error here, reset this to avoid spurious future error */
283 }
284 }
285 if(targetUniChar < 0xfffe){
286 if(args->offsets) {
287 args->offsets[myTarget - args->target]=(int32_t)(mySource - args->source - 1-(myData->isStateDBCS));
288 }
289
290 *(myTarget++)=(UChar)targetUniChar;
291 }
292 else /* targetUniChar>=0xfffe */ {
293 if(targetUniChar == 0xfffe){
294 *err = U_INVALID_CHAR_FOUND;
295 }
296 else{
297 *err = U_ILLEGAL_CHAR_FOUND;
298 }
299 if(mySourceChar > 0xff){
300 args->converter->toUBytes[0] = (uint8_t)(mySourceChar >> 8);
301 args->converter->toUBytes[1] = (uint8_t)mySourceChar;
302 args->converter->toULength=2;
303 }
304 else{
305 args->converter->toUBytes[0] = (uint8_t)mySourceChar;
306 args->converter->toULength=1;
307 }
308 break;
309 }
310 }
311 else{
312 *err =U_BUFFER_OVERFLOW_ERROR;
313 break;
314 }
315 }
316
317 args->target = myTarget;
318 args->source = mySource;
319 }
320
321
322 static void
323 UConverter_fromUnicode_HZ_OFFSETS_LOGIC (UConverterFromUnicodeArgs * args,
324 UErrorCode * err){
325 const UChar *mySource = args->source;
326 char *myTarget = args->target;
327 int32_t* offsets = args->offsets;
328 int32_t mySourceIndex = 0;
329 int32_t myTargetIndex = 0;
330 int32_t targetLength = (int32_t)(args->targetLimit - myTarget);
331 int32_t mySourceLength = (int32_t)(args->sourceLimit - args->source);
332 int32_t length=0;
333 uint32_t targetUniChar = 0x0000;
334 UChar32 mySourceChar = 0x0000;
335 UConverterDataHZ *myConverterData=(UConverterDataHZ*)args->converter->extraInfo;
336 UBool isTargetUCharDBCS = (UBool) myConverterData->isTargetUCharDBCS;
337 UBool oldIsTargetUCharDBCS = isTargetUCharDBCS;
338 int len =0;
339 const char* escSeq=NULL;
340
341 /* Calling code already handles this situation. */
342 /*if ((args->converter == NULL) || (args->targetLimit < myTarget) || (args->sourceLimit < args->source)){
343 *err = U_ILLEGAL_ARGUMENT_ERROR;
344 return;
345 }*/
346 if(args->converter->fromUChar32!=0 && myTargetIndex < targetLength) {
347 goto getTrail;
348 }
349 /*writing the char to the output stream */
350 while (mySourceIndex < mySourceLength){
351 targetUniChar = missingCharMarker;
352 if (myTargetIndex < targetLength){
353
354 mySourceChar = (UChar) mySource[mySourceIndex++];
355
356
357 oldIsTargetUCharDBCS = isTargetUCharDBCS;
358 if(mySourceChar ==UCNV_TILDE){
359 /*concatEscape(args, &myTargetIndex, &targetLength,"\x7E\x7E",err,2,&mySourceIndex);*/
360 len = ESC_LEN;
361 escSeq = TILDE_ESCAPE;
362 CONCAT_ESCAPE_MACRO(args, myTargetIndex, targetLength, escSeq,err,len,mySourceIndex);
363 continue;
364 } else if(mySourceChar <= 0x7f) {
365 length = 1;
366 targetUniChar = mySourceChar;
367 } else {
368 length= ucnv_MBCSFromUChar32(myConverterData->gbConverter->sharedData,
369 mySourceChar,&targetUniChar,args->converter->useFallback);
370 /* we can only use lead bytes 21..7D and trail bytes 21..7E */
371 if( length == 2 &&
372 (uint16_t)(targetUniChar - 0xa1a1) <= (0xfdfe - 0xa1a1) &&
373 (uint8_t)(targetUniChar - 0xa1) <= (0xfe - 0xa1)
374 ) {
375 targetUniChar -= 0x8080;
376 } else {
377 targetUniChar = missingCharMarker;
378 }
379 }
380 if (targetUniChar != missingCharMarker){
381 myConverterData->isTargetUCharDBCS = isTargetUCharDBCS = (UBool)(targetUniChar>0x00FF);
382 if(oldIsTargetUCharDBCS != isTargetUCharDBCS || !myConverterData->isEscapeAppended ){
383 /*Shifting from a double byte to single byte mode*/
384 if(!isTargetUCharDBCS){
385 len =ESC_LEN;
386 escSeq = SB_ESCAPE;
387 CONCAT_ESCAPE_MACRO(args, myTargetIndex, targetLength, escSeq,err,len,mySourceIndex);
388 myConverterData->isEscapeAppended = TRUE;
389 }
390 else{ /* Shifting from a single byte to double byte mode*/
391 len =ESC_LEN;
392 escSeq = DB_ESCAPE;
393 CONCAT_ESCAPE_MACRO(args, myTargetIndex, targetLength, escSeq,err,len,mySourceIndex);
394 myConverterData->isEscapeAppended = TRUE;
395
396 }
397 }
398
399 if(isTargetUCharDBCS){
400 if( myTargetIndex <targetLength){
401 myTarget[myTargetIndex++] =(char) (targetUniChar >> 8);
402 if(offsets){
403 *(offsets++) = mySourceIndex-1;
404 }
405 if(myTargetIndex < targetLength){
406 myTarget[myTargetIndex++] =(char) targetUniChar;
407 if(offsets){
408 *(offsets++) = mySourceIndex-1;
409 }
410 }else{
411 args->converter->charErrorBuffer[args->converter->charErrorBufferLength++] = (char) targetUniChar;
412 *err = U_BUFFER_OVERFLOW_ERROR;
413 }
414 }else{
415 args->converter->charErrorBuffer[args->converter->charErrorBufferLength++] =(char) (targetUniChar >> 8);
416 args->converter->charErrorBuffer[args->converter->charErrorBufferLength++] = (char) targetUniChar;
417 *err = U_BUFFER_OVERFLOW_ERROR;
418 }
419
420 }else{
421 if( myTargetIndex <targetLength){
422 myTarget[myTargetIndex++] = (char) (targetUniChar );
423 if(offsets){
424 *(offsets++) = mySourceIndex-1;
425 }
426
427 }else{
428 args->converter->charErrorBuffer[args->converter->charErrorBufferLength++] = (char) targetUniChar;
429 *err = U_BUFFER_OVERFLOW_ERROR;
430 }
431 }
432
433 }
434 else{
435 /* oops.. the code point is unassigned */
436 /*Handle surrogates */
437 /*check if the char is a First surrogate*/
438 if(UTF_IS_SURROGATE(mySourceChar)) {
439 if(UTF_IS_SURROGATE_FIRST(mySourceChar)) {
440 args->converter->fromUChar32=mySourceChar;
441 getTrail:
442 /*look ahead to find the trail surrogate*/
443 if(mySourceIndex < mySourceLength) {
444 /* test the following code unit */
445 UChar trail=(UChar) args->source[mySourceIndex];
446 if(UTF_IS_SECOND_SURROGATE(trail)) {
447 ++mySourceIndex;
448 mySourceChar=UTF16_GET_PAIR_VALUE(args->converter->fromUChar32, trail);
449 args->converter->fromUChar32=0x00;
450 /* there are no surrogates in GB2312*/
451 *err = U_INVALID_CHAR_FOUND;
452 /* exit this condition tree */
453 } else {
454 /* this is an unmatched lead code unit (1st surrogate) */
455 /* callback(illegal) */
456 *err=U_ILLEGAL_CHAR_FOUND;
457 }
458 } else {
459 /* no more input */
460 *err = U_ZERO_ERROR;
461 }
462 } else {
463 /* this is an unmatched trail code unit (2nd surrogate) */
464 /* callback(illegal) */
465 *err=U_ILLEGAL_CHAR_FOUND;
466 }
467 } else {
468 /* callback(unassigned) for a BMP code point */
469 *err = U_INVALID_CHAR_FOUND;
470 }
471
472 args->converter->fromUChar32=mySourceChar;
473 break;
474 }
475 }
476 else{
477 *err = U_BUFFER_OVERFLOW_ERROR;
478 break;
479 }
480 targetUniChar=missingCharMarker;
481 }
482
483 args->target += myTargetIndex;
484 args->source += mySourceIndex;
485 myConverterData->isTargetUCharDBCS = isTargetUCharDBCS;
486 }
487
488 static void
489 _HZ_WriteSub(UConverterFromUnicodeArgs *args, int32_t offsetIndex, UErrorCode *err) {
490 UConverter *cnv = args->converter;
491 UConverterDataHZ *convData=(UConverterDataHZ *) cnv->extraInfo;
492 char *p;
493 char buffer[4];
494 p = buffer;
495
496 if( convData->isTargetUCharDBCS){
497 *p++= UCNV_TILDE;
498 *p++= UCNV_CLOSE_BRACE;
499 convData->isTargetUCharDBCS=FALSE;
500 }
501 *p++= (char)cnv->subChars[0];
502
503 ucnv_cbFromUWriteBytes(args,
504 buffer, (int32_t)(p - buffer),
505 offsetIndex, err);
506 }
507
508 /*
509 * Structure for cloning an HZ converter into a single memory block.
510 * ucnv_safeClone() of the HZ converter will align the entire cloneHZStruct,
511 * and then ucnv_safeClone() of the sub-converter may additionally align
512 * subCnv inside the cloneHZStruct, for which we need the deadSpace after
513 * subCnv. This is because UAlignedMemory may be larger than the actually
514 * necessary alignment size for the platform.
515 * The other cloneHZStruct fields will not be moved around,
516 * and are aligned properly with cloneHZStruct's alignment.
517 */
518 struct cloneHZStruct
519 {
520 UConverter cnv;
521 UConverter subCnv;
522 UAlignedMemory deadSpace;
523 UConverterDataHZ mydata;
524 };
525
526
527 static UConverter *
528 _HZ_SafeClone(const UConverter *cnv,
529 void *stackBuffer,
530 int32_t *pBufferSize,
531 UErrorCode *status)
532 {
533 struct cloneHZStruct * localClone;
534 int32_t size, bufferSizeNeeded = sizeof(struct cloneHZStruct);
535
536 if (U_FAILURE(*status)){
537 return 0;
538 }
539
540 if (*pBufferSize == 0){ /* 'preflighting' request - set needed size into *pBufferSize */
541 *pBufferSize = bufferSizeNeeded;
542 return 0;
543 }
544
545 localClone = (struct cloneHZStruct *)stackBuffer;
546 /* ucnv.c/ucnv_safeClone() copied the main UConverter already */
547
548 uprv_memcpy(&localClone->mydata, cnv->extraInfo, sizeof(UConverterDataHZ));
549 localClone->cnv.extraInfo = &localClone->mydata;
550 localClone->cnv.isExtraLocal = TRUE;
551
552 /* deep-clone the sub-converter */
553 size = (int32_t)(sizeof(UConverter) + sizeof(UAlignedMemory)); /* include size of padding */
554 ((UConverterDataHZ*)localClone->cnv.extraInfo)->gbConverter =
555 ucnv_safeClone(((UConverterDataHZ*)cnv->extraInfo)->gbConverter, &localClone->subCnv, &size, status);
556
557 return &localClone->cnv;
558 }
559
560 static void
561 _HZ_GetUnicodeSet(const UConverter *cnv,
562 const USetAdder *sa,
563 UConverterUnicodeSet which,
564 UErrorCode *pErrorCode) {
565 /* HZ converts all of ASCII */
566 sa->addRange(sa->set, 0, 0x7f);
567
568 /* add all of the code points that the sub-converter handles */
569 ucnv_MBCSGetFilteredUnicodeSetForUnicode(
570 ((UConverterDataHZ*)cnv->extraInfo)->gbConverter->sharedData,
571 sa, which, UCNV_SET_FILTER_HZ,
572 pErrorCode);
573 }
574
575 static const UConverterImpl _HZImpl={
576
577 UCNV_HZ,
578
579 NULL,
580 NULL,
581
582 _HZOpen,
583 _HZClose,
584 _HZReset,
585
586 UConverter_toUnicode_HZ_OFFSETS_LOGIC,
587 UConverter_toUnicode_HZ_OFFSETS_LOGIC,
588 UConverter_fromUnicode_HZ_OFFSETS_LOGIC,
589 UConverter_fromUnicode_HZ_OFFSETS_LOGIC,
590 NULL,
591
592 NULL,
593 NULL,
594 _HZ_WriteSub,
595 _HZ_SafeClone,
596 _HZ_GetUnicodeSet
597 };
598
599 static const UConverterStaticData _HZStaticData={
600 sizeof(UConverterStaticData),
601 "HZ",
602 0,
603 UCNV_IBM,
604 UCNV_HZ,
605 1,
606 4,
607 { 0x1a, 0, 0, 0 },
608 1,
609 FALSE,
610 FALSE,
611 0,
612 0,
613 { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 }, /* reserved */
614
615 };
616
617
618 const UConverterSharedData _HZData={
619 sizeof(UConverterSharedData),
620 ~((uint32_t) 0),
621 NULL,
622 NULL,
623 &_HZStaticData,
624 FALSE,
625 &_HZImpl,
626 0
627 };
628
629 #endif /* #if !UCONFIG_NO_LEGACY_CONVERSION */