Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Side by Side Diff: third_party/libxml/src/encoding.c

Issue 1193533007: Upgrade to libxml 2.9.2 and libxslt 1.1.28 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: no iconv Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/libxml/src/enc.h ('k') | third_party/libxml/src/entities.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * encoding.c : implements the encoding conversion functions needed for XML 2 * encoding.c : implements the encoding conversion functions needed for XML
3 * 3 *
4 * Related specs: 4 * Related specs:
5 * rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies 5 * rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies
6 * rfc2781 UTF-16, an encoding of ISO 10646, P. Hoffman, F. Yergeau 6 * rfc2781 UTF-16, an encoding of ISO 10646, P. Hoffman, F. Yergeau
7 * [ISO-10646] UTF-8 and UTF-16 in Annexes 7 * [ISO-10646] UTF-8 and UTF-16 in Annexes
8 * [ISO-8859-1] ISO Latin-1 characters codes. 8 * [ISO-8859-1] ISO Latin-1 characters codes.
9 * [UNICODE] The Unicode Consortium, "The Unicode Standard -- 9 * [UNICODE] The Unicode Consortium, "The Unicode Standard --
10 * Worldwide Character Encoding -- Version 1.0", Addison- 10 * Worldwide Character Encoding -- Version 1.0", Addison-
11 * Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is 11 * Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is
12 * described in Unicode Technical Report #4. 12 * described in Unicode Technical Report #4.
13 * [US-ASCII] Coded Character Set--7-bit American Standard Code for 13 * [US-ASCII] Coded Character Set--7-bit American Standard Code for
14 * Information Interchange, ANSI X3.4-1986. 14 * Information Interchange, ANSI X3.4-1986.
15 * 15 *
16 * See Copyright for the status of this software. 16 * See Copyright for the status of this software.
17 * 17 *
18 * daniel@veillard.com 18 * daniel@veillard.com
19 * 19 *
20 * Original code for IsoLatin1 and UTF-16 by "Martin J. Duerst" <duerst@w3.org> 20 * Original code for IsoLatin1 and UTF-16 by "Martin J. Duerst" <duerst@w3.org>
21 */ 21 */
22 22
23 #define IN_LIBXML 23 #define IN_LIBXML
24 #include "libxml.h" 24 #include "libxml.h"
25 25
26 #include <string.h> 26 #include <string.h>
27 #include <limits.h>
27 28
28 #ifdef HAVE_CTYPE_H 29 #ifdef HAVE_CTYPE_H
29 #include <ctype.h> 30 #include <ctype.h>
30 #endif 31 #endif
31 #ifdef HAVE_STDLIB_H 32 #ifdef HAVE_STDLIB_H
32 #include <stdlib.h> 33 #include <stdlib.h>
33 #endif 34 #endif
34 #ifdef LIBXML_ICONV_ENABLED 35 #ifdef LIBXML_ICONV_ENABLED
35 #ifdef HAVE_ERRNO_H 36 #ifdef HAVE_ERRNO_H
36 #include <errno.h> 37 #include <errno.h>
37 #endif 38 #endif
38 #endif 39 #endif
39 #include <libxml/encoding.h> 40 #include <libxml/encoding.h>
40 #include <libxml/xmlmemory.h> 41 #include <libxml/xmlmemory.h>
41 #ifdef LIBXML_HTML_ENABLED 42 #ifdef LIBXML_HTML_ENABLED
42 #include <libxml/HTMLparser.h> 43 #include <libxml/HTMLparser.h>
43 #endif 44 #endif
44 #include <libxml/globals.h> 45 #include <libxml/globals.h>
45 #include <libxml/xmlerror.h> 46 #include <libxml/xmlerror.h>
46 47
48 #include "buf.h"
49 #include "enc.h"
50
47 static xmlCharEncodingHandlerPtr xmlUTF16LEHandler = NULL; 51 static xmlCharEncodingHandlerPtr xmlUTF16LEHandler = NULL;
48 static xmlCharEncodingHandlerPtr xmlUTF16BEHandler = NULL; 52 static xmlCharEncodingHandlerPtr xmlUTF16BEHandler = NULL;
49 53
50 typedef struct _xmlCharEncodingAlias xmlCharEncodingAlias; 54 typedef struct _xmlCharEncodingAlias xmlCharEncodingAlias;
51 typedef xmlCharEncodingAlias *xmlCharEncodingAliasPtr; 55 typedef xmlCharEncodingAlias *xmlCharEncodingAliasPtr;
52 struct _xmlCharEncodingAlias { 56 struct _xmlCharEncodingAlias {
53 const char *name; 57 const char *name;
54 const char *alias; 58 const char *alias;
55 }; 59 };
56 60
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 */ 95 */
92 static void 96 static void
93 xmlEncodingErr(xmlParserErrors error, const char *msg, const char *val) 97 xmlEncodingErr(xmlParserErrors error, const char *msg, const char *val)
94 { 98 {
95 __xmlRaiseError(NULL, NULL, NULL, NULL, NULL, 99 __xmlRaiseError(NULL, NULL, NULL, NULL, NULL,
96 XML_FROM_I18N, error, XML_ERR_FATAL, 100 XML_FROM_I18N, error, XML_ERR_FATAL,
97 NULL, 0, val, NULL, NULL, 0, 0, msg, val); 101 NULL, 0, val, NULL, NULL, 0, 0, msg, val);
98 } 102 }
99 103
100 #ifdef LIBXML_ICU_ENABLED 104 #ifdef LIBXML_ICU_ENABLED
101 static uconv_t* 105 static uconv_t*
102 openIcuConverter(const char* name, int toUnicode) 106 openIcuConverter(const char* name, int toUnicode)
103 { 107 {
104 UErrorCode status = U_ZERO_ERROR; 108 UErrorCode status = U_ZERO_ERROR;
105 uconv_t *conv = (uconv_t *) xmlMalloc(sizeof(uconv_t)); 109 uconv_t *conv = (uconv_t *) xmlMalloc(sizeof(uconv_t));
106 if (conv == NULL) 110 if (conv == NULL)
107 return NULL; 111 return NULL;
108 112
109 conv->uconv = ucnv_open(name, &status); 113 conv->uconv = ucnv_open(name, &status);
110 if (U_FAILURE(status)) 114 if (U_FAILURE(status))
111 goto error; 115 goto error;
112 116
113 status = U_ZERO_ERROR; 117 status = U_ZERO_ERROR;
114 if (toUnicode) { 118 if (toUnicode) {
115 ucnv_setToUCallBack(conv->uconv, UCNV_TO_U_CALLBACK_STOP, 119 ucnv_setToUCallBack(conv->uconv, UCNV_TO_U_CALLBACK_STOP,
116 NULL, NULL, NULL, &status); 120 NULL, NULL, NULL, &status);
117 } 121 }
118 else { 122 else {
119 ucnv_setFromUCallBack(conv->uconv, UCNV_FROM_U_CALLBACK_STOP, 123 ucnv_setFromUCallBack(conv->uconv, UCNV_FROM_U_CALLBACK_STOP,
120 NULL, NULL, NULL, &status); 124 NULL, NULL, NULL, &status);
121 } 125 }
122 if (U_FAILURE(status)) 126 if (U_FAILURE(status))
123 goto error; 127 goto error;
124 128
125 status = U_ZERO_ERROR; 129 status = U_ZERO_ERROR;
126 conv->utf8 = ucnv_open("UTF-8", &status); 130 conv->utf8 = ucnv_open("UTF-8", &status);
127 if (U_SUCCESS(status)) 131 if (U_SUCCESS(status))
128 return conv; 132 return conv;
129 133
130 error: 134 error:
131 if (conv->uconv) 135 if (conv->uconv)
132 ucnv_close(conv->uconv); 136 ucnv_close(conv->uconv);
133 xmlFree(conv); 137 xmlFree(conv);
134 return NULL; 138 return NULL;
135 } 139 }
136 140
137 static void 141 static void
138 closeIcuConverter(uconv_t *conv) 142 closeIcuConverter(uconv_t *conv)
139 { 143 {
140 if (conv != NULL) { 144 if (conv != NULL) {
141 ucnv_close(conv->uconv); 145 ucnv_close(conv->uconv);
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 unsigned int c; 180 unsigned int c;
177 181
178 inend = in + (*inlen); 182 inend = in + (*inlen);
179 while ((in < inend) && (out - outstart + 5 < *outlen)) { 183 while ((in < inend) && (out - outstart + 5 < *outlen)) {
180 c= *in++; 184 c= *in++;
181 185
182 if (out >= outend) 186 if (out >= outend)
183 break; 187 break;
184 if (c < 0x80) { 188 if (c < 0x80) {
185 *out++ = c; 189 *out++ = c;
186 » } else { 190 » } else {
187 *outlen = out - outstart; 191 *outlen = out - outstart;
188 *inlen = processed - base; 192 *inlen = processed - base;
189 return(-1); 193 return(-1);
190 } 194 }
191 195
192 processed = (const unsigned char*) in; 196 processed = (const unsigned char*) in;
193 } 197 }
194 *outlen = out - outstart; 198 *outlen = out - outstart;
195 *inlen = processed - base; 199 *inlen = processed - base;
196 return(*outlen); 200 return(*outlen);
197 } 201 }
198 202
199 #ifdef LIBXML_OUTPUT_ENABLED 203 #ifdef LIBXML_OUTPUT_ENABLED
200 /** 204 /**
201 * UTF8Toascii: 205 * UTF8Toascii:
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 else if (d < 0xF8) { c= d & 0x07; trailing= 3; } 251 else if (d < 0xF8) { c= d & 0x07; trailing= 3; }
248 else { 252 else {
249 /* no chance for this in Ascii */ 253 /* no chance for this in Ascii */
250 *outlen = out - outstart; 254 *outlen = out - outstart;
251 *inlen = processed - instart; 255 *inlen = processed - instart;
252 return(-2); 256 return(-2);
253 } 257 }
254 258
255 if (inend - in < trailing) { 259 if (inend - in < trailing) {
256 break; 260 break;
257 » } 261 » }
258 262
259 for ( ; trailing; trailing--) { 263 for ( ; trailing; trailing--) {
260 if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80)) 264 if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80))
261 break; 265 break;
262 c <<= 6; 266 c <<= 6;
263 c |= d & 0x3F; 267 c |= d & 0x3F;
264 } 268 }
265 269
266 /* assertion: c is a single UTF-4 value */ 270 /* assertion: c is a single UTF-4 value */
267 if (c < 0x80) { 271 if (c < 0x80) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 unsigned char* outend; 308 unsigned char* outend;
305 const unsigned char* inend; 309 const unsigned char* inend;
306 const unsigned char* instop; 310 const unsigned char* instop;
307 311
308 if ((out == NULL) || (in == NULL) || (outlen == NULL) || (inlen == NULL)) 312 if ((out == NULL) || (in == NULL) || (outlen == NULL) || (inlen == NULL))
309 return(-1); 313 return(-1);
310 314
311 outend = out + *outlen; 315 outend = out + *outlen;
312 inend = in + (*inlen); 316 inend = in + (*inlen);
313 instop = inend; 317 instop = inend;
314 318
315 while (in < inend && out < outend - 1) { 319 while ((in < inend) && (out < outend - 1)) {
316 » if (*in >= 0x80) { 320 » if (*in >= 0x80) {
317 *out++ = (((*in) >> 6) & 0x1F) | 0xC0; 321 *out++ = (((*in) >> 6) & 0x1F) | 0xC0;
318 *out++ = ((*in) & 0x3F) | 0x80; 322 *out++ = ((*in) & 0x3F) | 0x80;
319 ++in; 323 ++in;
320 } 324 }
321 » if (instop - in > outend - out) instop = in + (outend - out); 325 » if ((instop - in) > (outend - out)) instop = in + (outend - out);
322 » while (in < instop && *in < 0x80) { 326 » while ((in < instop) && (*in < 0x80)) {
323 *out++ = *in++; 327 *out++ = *in++;
324 } 328 }
325 }» 329 }
326 if (in < inend && out < outend && *in < 0x80) { 330 if ((in < inend) && (out < outend) && (*in < 0x80)) {
327 *out++ = *in++; 331 *out++ = *in++;
328 } 332 }
329 *outlen = out - outstart; 333 *outlen = out - outstart;
330 *inlen = in - base; 334 *inlen = in - base;
331 return(*outlen); 335 return(*outlen);
332 } 336 }
333 337
334 /** 338 /**
335 * UTF8ToUTF8: 339 * UTF8ToUTF8:
336 * @out: a pointer to an array of bytes to store the result 340 * @out: a pointer to an array of bytes to store the result
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 else if (d < 0xF8) { c= d & 0x07; trailing= 3; } 424 else if (d < 0xF8) { c= d & 0x07; trailing= 3; }
421 else { 425 else {
422 /* no chance for this in IsoLat1 */ 426 /* no chance for this in IsoLat1 */
423 *outlen = out - outstart; 427 *outlen = out - outstart;
424 *inlen = processed - instart; 428 *inlen = processed - instart;
425 return(-2); 429 return(-2);
426 } 430 }
427 431
428 if (inend - in < trailing) { 432 if (inend - in < trailing) {
429 break; 433 break;
430 » } 434 » }
431 435
432 for ( ; trailing; trailing--) { 436 for ( ; trailing; trailing--) {
433 if (in >= inend) 437 if (in >= inend)
434 break; 438 break;
435 if (((d= *in++) & 0xC0) != 0x80) { 439 if (((d= *in++) & 0xC0) != 0x80) {
436 *outlen = out - outstart; 440 *outlen = out - outstart;
437 *inlen = processed - instart; 441 *inlen = processed - instart;
438 return(-2); 442 return(-2);
439 } 443 }
440 c <<= 6; 444 c <<= 6;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 } 532 }
529 } 533 }
530 534
531 /* assertion: c is a single UTF-4 value */ 535 /* assertion: c is a single UTF-4 value */
532 if (out >= outend) 536 if (out >= outend)
533 break; 537 break;
534 if (c < 0x80) { *out++= c; bits= -6; } 538 if (c < 0x80) { *out++= c; bits= -6; }
535 else if (c < 0x800) { *out++= ((c >> 6) & 0x1F) | 0xC0; bits= 0; } 539 else if (c < 0x800) { *out++= ((c >> 6) & 0x1F) | 0xC0; bits= 0; }
536 else if (c < 0x10000) { *out++= ((c >> 12) & 0x0F) | 0xE0; bits= 6; } 540 else if (c < 0x10000) { *out++= ((c >> 12) & 0x0F) | 0xE0; bits= 6; }
537 else { *out++= ((c >> 18) & 0x07) | 0xF0; bits= 12; } 541 else { *out++= ((c >> 18) & 0x07) | 0xF0; bits= 12; }
538 542
539 for ( ; bits >= 0; bits-= 6) { 543 for ( ; bits >= 0; bits-= 6) {
540 if (out >= outend) 544 if (out >= outend)
541 break; 545 break;
542 *out++= ((c >> bits) & 0x3F) | 0x80; 546 *out++= ((c >> bits) & 0x3F) | 0x80;
543 } 547 }
544 processed = (const unsigned char*) in; 548 processed = (const unsigned char*) in;
545 } 549 }
546 *outlen = out - outstart; 550 *outlen = out - outstart;
547 *inlenb = processed - inb; 551 *inlenb = processed - inb;
548 return(*outlen); 552 return(*outlen);
549 } 553 }
550 554
551 #ifdef LIBXML_OUTPUT_ENABLED 555 #ifdef LIBXML_OUTPUT_ENABLED
552 /** 556 /**
553 * UTF8ToUTF16LE: 557 * UTF8ToUTF16LE:
554 * @outb: a pointer to an array of bytes to store the result 558 * @outb: a pointer to an array of bytes to store the result
555 * @outlen: the length of @outb 559 * @outlen: the length of @outb
556 * @in: a pointer to an array of UTF-8 chars 560 * @in: a pointer to an array of UTF-8 chars
557 * @inlen: the length of @in 561 * @inlen: the length of @in
558 * 562 *
559 * Take a block of UTF-8 chars in and try to convert it to an UTF-16LE 563 * Take a block of UTF-8 chars in and try to convert it to an UTF-16LE
560 * block of chars out. 564 * block of chars out.
561 * 565 *
562 * Returns the number of bytes written, or -1 if lack of space, or -2 566 * Returns the number of bytes written, or -1 if lack of space, or -2
563 * if the transcoding failed. 567 * if the transcoding failed.
564 */ 568 */
565 static int 569 static int
566 UTF8ToUTF16LE(unsigned char* outb, int *outlen, 570 UTF8ToUTF16LE(unsigned char* outb, int *outlen,
567 const unsigned char* in, int *inlen) 571 const unsigned char* in, int *inlen)
568 { 572 {
569 unsigned short* out = (unsigned short*) outb; 573 unsigned short* out = (unsigned short*) outb;
570 const unsigned char* processed = in; 574 const unsigned char* processed = in;
571 const unsigned char *const instart = in; 575 const unsigned char *const instart = in;
572 unsigned short* outstart= out; 576 unsigned short* outstart= out;
573 unsigned short* outend; 577 unsigned short* outend;
(...skipping 25 matching lines...) Expand all
599 else if (d < 0xF8) { c= d & 0x07; trailing= 3; } 603 else if (d < 0xF8) { c= d & 0x07; trailing= 3; }
600 else { 604 else {
601 /* no chance for this in UTF-16 */ 605 /* no chance for this in UTF-16 */
602 *outlen = (out - outstart) * 2; 606 *outlen = (out - outstart) * 2;
603 *inlen = processed - instart; 607 *inlen = processed - instart;
604 return(-2); 608 return(-2);
605 } 609 }
606 610
607 if (inend - in < trailing) { 611 if (inend - in < trailing) {
608 break; 612 break;
609 } 613 }
610 614
611 for ( ; trailing; trailing--) { 615 for ( ; trailing; trailing--) {
612 if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80)) 616 if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80))
613 break; 617 break;
614 c <<= 6; 618 c <<= 6;
615 c |= d & 0x3F; 619 c |= d & 0x3F;
616 } 620 }
617 621
618 /* assertion: c is a single UTF-4 value */ 622 /* assertion: c is a single UTF-4 value */
619 if (c < 0x10000) { 623 if (c < 0x10000) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 * UTF8ToUTF16: 666 * UTF8ToUTF16:
663 * @outb: a pointer to an array of bytes to store the result 667 * @outb: a pointer to an array of bytes to store the result
664 * @outlen: the length of @outb 668 * @outlen: the length of @outb
665 * @in: a pointer to an array of UTF-8 chars 669 * @in: a pointer to an array of UTF-8 chars
666 * @inlen: the length of @in 670 * @inlen: the length of @in
667 * 671 *
668 * Take a block of UTF-8 chars in and try to convert it to an UTF-16 672 * Take a block of UTF-8 chars in and try to convert it to an UTF-16
669 * block of chars out. 673 * block of chars out.
670 * 674 *
671 * Returns the number of bytes written, or -1 if lack of space, or -2 675 * Returns the number of bytes written, or -1 if lack of space, or -2
672 * if the transcoding failed. 676 * if the transcoding failed.
673 */ 677 */
674 static int 678 static int
675 UTF8ToUTF16(unsigned char* outb, int *outlen, 679 UTF8ToUTF16(unsigned char* outb, int *outlen,
676 const unsigned char* in, int *inlen) 680 const unsigned char* in, int *inlen)
677 { 681 {
678 if (in == NULL) { 682 if (in == NULL) {
679 /* 683 /*
680 * initialization, add the Byte Order Mark for UTF-16LE 684 * initialization, add the Byte Order Mark for UTF-16LE
681 */ 685 */
682 if (*outlen >= 2) { 686 if (*outlen >= 2) {
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 inend= in + inlen; 738 inend= in + inlen;
735 while (in < inend) { 739 while (in < inend) {
736 if (xmlLittleEndian) { 740 if (xmlLittleEndian) {
737 tmp = (unsigned char *) in; 741 tmp = (unsigned char *) in;
738 c = *tmp++; 742 c = *tmp++;
739 c = c << 8; 743 c = c << 8;
740 c = c | (unsigned int) *tmp; 744 c = c | (unsigned int) *tmp;
741 in++; 745 in++;
742 } else { 746 } else {
743 c= *in++; 747 c= *in++;
744 » } 748 » }
745 if ((c & 0xFC00) == 0xD800) { /* surrogates */ 749 if ((c & 0xFC00) == 0xD800) { /* surrogates */
746 if (in >= inend) { /* (in > inend) shouldn't happens */ 750 if (in >= inend) { /* (in > inend) shouldn't happens */
747 *outlen = out - outstart; 751 *outlen = out - outstart;
748 *inlenb = processed - inb; 752 *inlenb = processed - inb;
749 return(-2); 753 return(-2);
750 } 754 }
751 if (xmlLittleEndian) { 755 if (xmlLittleEndian) {
752 tmp = (unsigned char *) in; 756 tmp = (unsigned char *) in;
753 d = *tmp++; 757 d = *tmp++;
754 d = d << 8; 758 d = d << 8;
755 d = d | (unsigned int) *tmp; 759 d = d | (unsigned int) *tmp;
756 in++; 760 in++;
757 } else { 761 } else {
758 d= *in++; 762 d= *in++;
759 } 763 }
760 if ((d & 0xFC00) == 0xDC00) { 764 if ((d & 0xFC00) == 0xDC00) {
761 c &= 0x03FF; 765 c &= 0x03FF;
762 c <<= 10; 766 c <<= 10;
763 c |= d & 0x03FF; 767 c |= d & 0x03FF;
764 c += 0x10000; 768 c += 0x10000;
765 } 769 }
766 else { 770 else {
767 *outlen = out - outstart; 771 *outlen = out - outstart;
768 *inlenb = processed - inb; 772 *inlenb = processed - inb;
769 return(-2); 773 return(-2);
770 } 774 }
771 } 775 }
772 776
773 /* assertion: c is a single UTF-4 value */ 777 /* assertion: c is a single UTF-4 value */
774 if (out >= outend) 778 if (out >= outend)
775 break; 779 break;
776 if (c < 0x80) { *out++= c; bits= -6; } 780 if (c < 0x80) { *out++= c; bits= -6; }
777 else if (c < 0x800) { *out++= ((c >> 6) & 0x1F) | 0xC0; bits= 0; } 781 else if (c < 0x800) { *out++= ((c >> 6) & 0x1F) | 0xC0; bits= 0; }
778 else if (c < 0x10000) { *out++= ((c >> 12) & 0x0F) | 0xE0; bits= 6; } 782 else if (c < 0x10000) { *out++= ((c >> 12) & 0x0F) | 0xE0; bits= 6; }
779 else { *out++= ((c >> 18) & 0x07) | 0xF0; bits= 12; } 783 else { *out++= ((c >> 18) & 0x07) | 0xF0; bits= 12; }
780 784
781 for ( ; bits >= 0; bits-= 6) { 785 for ( ; bits >= 0; bits-= 6) {
782 if (out >= outend) 786 if (out >= outend)
783 break; 787 break;
784 *out++= ((c >> bits) & 0x3F) | 0x80; 788 *out++= ((c >> bits) & 0x3F) | 0x80;
785 } 789 }
786 processed = (const unsigned char*) in; 790 processed = (const unsigned char*) in;
787 } 791 }
788 *outlen = out - outstart; 792 *outlen = out - outstart;
789 *inlenb = processed - inb; 793 *inlenb = processed - inb;
790 return(*outlen); 794 return(*outlen);
791 } 795 }
792 796
793 #ifdef LIBXML_OUTPUT_ENABLED 797 #ifdef LIBXML_OUTPUT_ENABLED
794 /** 798 /**
795 * UTF8ToUTF16BE: 799 * UTF8ToUTF16BE:
796 * @outb: a pointer to an array of bytes to store the result 800 * @outb: a pointer to an array of bytes to store the result
797 * @outlen: the length of @outb 801 * @outlen: the length of @outb
798 * @in: a pointer to an array of UTF-8 chars 802 * @in: a pointer to an array of UTF-8 chars
799 * @inlen: the length of @in 803 * @inlen: the length of @in
800 * 804 *
801 * Take a block of UTF-8 chars in and try to convert it to an UTF-16BE 805 * Take a block of UTF-8 chars in and try to convert it to an UTF-16BE
802 * block of chars out. 806 * block of chars out.
803 * 807 *
804 * Returns the number of byte written, or -1 by lack of space, or -2 808 * Returns the number of byte written, or -1 by lack of space, or -2
805 * if the transcoding failed. 809 * if the transcoding failed.
806 */ 810 */
807 static int 811 static int
808 UTF8ToUTF16BE(unsigned char* outb, int *outlen, 812 UTF8ToUTF16BE(unsigned char* outb, int *outlen,
809 const unsigned char* in, int *inlen) 813 const unsigned char* in, int *inlen)
810 { 814 {
811 unsigned short* out = (unsigned short*) outb; 815 unsigned short* out = (unsigned short*) outb;
812 const unsigned char* processed = in; 816 const unsigned char* processed = in;
813 const unsigned char *const instart = in; 817 const unsigned char *const instart = in;
814 unsigned short* outstart= out; 818 unsigned short* outstart= out;
815 unsigned short* outend; 819 unsigned short* outend;
(...skipping 25 matching lines...) Expand all
841 else if (d < 0xF8) { c= d & 0x07; trailing= 3; } 845 else if (d < 0xF8) { c= d & 0x07; trailing= 3; }
842 else { 846 else {
843 /* no chance for this in UTF-16 */ 847 /* no chance for this in UTF-16 */
844 *outlen = out - outstart; 848 *outlen = out - outstart;
845 *inlen = processed - instart; 849 *inlen = processed - instart;
846 return(-2); 850 return(-2);
847 } 851 }
848 852
849 if (inend - in < trailing) { 853 if (inend - in < trailing) {
850 break; 854 break;
851 } 855 }
852 856
853 for ( ; trailing; trailing--) { 857 for ( ; trailing; trailing--) {
854 if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80)) break; 858 if ((in >= inend) || (((d= *in++) & 0xC0) != 0x80)) break;
855 c <<= 6; 859 c <<= 6;
856 c |= d & 0x3F; 860 c |= d & 0x3F;
857 } 861 }
858 862
859 /* assertion: c is a single UTF-4 value */ 863 /* assertion: c is a single UTF-4 value */
860 if (c < 0x10000) { 864 if (c < 0x10000) {
861 if (out >= outend) break; 865 if (out >= outend) break;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 ************************************************************************/ 909 ************************************************************************/
906 910
907 /** 911 /**
908 * xmlDetectCharEncoding: 912 * xmlDetectCharEncoding:
909 * @in: a pointer to the first bytes of the XML entity, must be at least 913 * @in: a pointer to the first bytes of the XML entity, must be at least
910 * 2 bytes long (at least 4 if encoding is UTF4 variant). 914 * 2 bytes long (at least 4 if encoding is UTF4 variant).
911 * @len: pointer to the length of the buffer 915 * @len: pointer to the length of the buffer
912 * 916 *
913 * Guess the encoding of the entity using the first bytes of the entity content 917 * Guess the encoding of the entity using the first bytes of the entity content
914 * according to the non-normative appendix F of the XML-1.0 recommendation. 918 * according to the non-normative appendix F of the XML-1.0 recommendation.
915 * 919 *
916 * Returns one of the XML_CHAR_ENCODING_... values. 920 * Returns one of the XML_CHAR_ENCODING_... values.
917 */ 921 */
918 xmlCharEncoding 922 xmlCharEncoding
919 xmlDetectCharEncoding(const unsigned char* in, int len) 923 xmlDetectCharEncoding(const unsigned char* in, int len)
920 { 924 {
921 if (in == NULL) 925 if (in == NULL)
922 return(XML_CHAR_ENCODING_NONE); 926 return(XML_CHAR_ENCODING_NONE);
923 if (len >= 4) { 927 if (len >= 4) {
924 if ((in[0] == 0x00) && (in[1] == 0x00) && 928 if ((in[0] == 0x00) && (in[1] == 0x00) &&
925 (in[2] == 0x00) && (in[3] == 0x3C)) 929 (in[2] == 0x00) && (in[3] == 0x3C))
926 return(XML_CHAR_ENCODING_UCS4BE); 930 return(XML_CHAR_ENCODING_UCS4BE);
927 if ((in[0] == 0x3C) && (in[1] == 0x00) && 931 if ((in[0] == 0x3C) && (in[1] == 0x00) &&
928 (in[2] == 0x00) && (in[3] == 0x00)) 932 (in[2] == 0x00) && (in[3] == 0x00))
929 return(XML_CHAR_ENCODING_UCS4LE); 933 return(XML_CHAR_ENCODING_UCS4LE);
930 if ((in[0] == 0x00) && (in[1] == 0x00) && 934 if ((in[0] == 0x00) && (in[1] == 0x00) &&
931 (in[2] == 0x3C) && (in[3] == 0x00)) 935 (in[2] == 0x3C) && (in[3] == 0x00))
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 xmlCharEncodingAliasesMax = 0; 996 xmlCharEncodingAliasesMax = 0;
993 xmlFree(xmlCharEncodingAliases); 997 xmlFree(xmlCharEncodingAliases);
994 xmlCharEncodingAliases = NULL; 998 xmlCharEncodingAliases = NULL;
995 } 999 }
996 1000
997 /** 1001 /**
998 * xmlGetEncodingAlias: 1002 * xmlGetEncodingAlias:
999 * @alias: the alias name as parsed, in UTF-8 format (ASCII actually) 1003 * @alias: the alias name as parsed, in UTF-8 format (ASCII actually)
1000 * 1004 *
1001 * Lookup an encoding name for the given alias. 1005 * Lookup an encoding name for the given alias.
1002 * 1006 *
1003 * Returns NULL if not found, otherwise the original name 1007 * Returns NULL if not found, otherwise the original name
1004 */ 1008 */
1005 const char * 1009 const char *
1006 xmlGetEncodingAlias(const char *alias) { 1010 xmlGetEncodingAlias(const char *alias) {
1007 int i; 1011 int i;
1008 char upper[100]; 1012 char upper[100];
1009 1013
1010 if (alias == NULL) 1014 if (alias == NULL)
1011 return(NULL); 1015 return(NULL);
1012 1016
(...skipping 17 matching lines...) Expand all
1030 return(NULL); 1034 return(NULL);
1031 } 1035 }
1032 1036
1033 /** 1037 /**
1034 * xmlAddEncodingAlias: 1038 * xmlAddEncodingAlias:
1035 * @name: the encoding name as parsed, in UTF-8 format (ASCII actually) 1039 * @name: the encoding name as parsed, in UTF-8 format (ASCII actually)
1036 * @alias: the alias name as parsed, in UTF-8 format (ASCII actually) 1040 * @alias: the alias name as parsed, in UTF-8 format (ASCII actually)
1037 * 1041 *
1038 * Registers an alias @alias for an encoding named @name. Existing alias 1042 * Registers an alias @alias for an encoding named @name. Existing alias
1039 * will be overwritten. 1043 * will be overwritten.
1040 * 1044 *
1041 * Returns 0 in case of success, -1 in case of error 1045 * Returns 0 in case of success, -1 in case of error
1042 */ 1046 */
1043 int 1047 int
1044 xmlAddEncodingAlias(const char *name, const char *alias) { 1048 xmlAddEncodingAlias(const char *name, const char *alias) {
1045 int i; 1049 int i;
1046 char upper[100]; 1050 char upper[100];
1047 1051
1048 if ((name == NULL) || (alias == NULL)) 1052 if ((name == NULL) || (alias == NULL))
1049 return(-1); 1053 return(-1);
1050 1054
1051 for (i = 0;i < 99;i++) { 1055 for (i = 0;i < 99;i++) {
1052 upper[i] = toupper(alias[i]); 1056 upper[i] = toupper(alias[i]);
1053 if (upper[i] == 0) break; 1057 if (upper[i] == 0) break;
1054 } 1058 }
1055 upper[i] = 0; 1059 upper[i] = 0;
1056 1060
1057 if (xmlCharEncodingAliases == NULL) { 1061 if (xmlCharEncodingAliases == NULL) {
1058 xmlCharEncodingAliasesNb = 0; 1062 xmlCharEncodingAliasesNb = 0;
1059 xmlCharEncodingAliasesMax = 20; 1063 xmlCharEncodingAliasesMax = 20;
1060 » xmlCharEncodingAliases = (xmlCharEncodingAliasPtr) 1064 » xmlCharEncodingAliases = (xmlCharEncodingAliasPtr)
1061 xmlMalloc(xmlCharEncodingAliasesMax * sizeof(xmlCharEncodingAlias) ); 1065 xmlMalloc(xmlCharEncodingAliasesMax * sizeof(xmlCharEncodingAlias) );
1062 if (xmlCharEncodingAliases == NULL) 1066 if (xmlCharEncodingAliases == NULL)
1063 return(-1); 1067 return(-1);
1064 } else if (xmlCharEncodingAliasesNb >= xmlCharEncodingAliasesMax) { 1068 } else if (xmlCharEncodingAliasesNb >= xmlCharEncodingAliasesMax) {
1065 xmlCharEncodingAliasesMax *= 2; 1069 xmlCharEncodingAliasesMax *= 2;
1066 » xmlCharEncodingAliases = (xmlCharEncodingAliasPtr) 1070 » xmlCharEncodingAliases = (xmlCharEncodingAliasPtr)
1067 xmlRealloc(xmlCharEncodingAliases, 1071 xmlRealloc(xmlCharEncodingAliases,
1068 xmlCharEncodingAliasesMax * sizeof(xmlCharEncodingAlias )); 1072 xmlCharEncodingAliasesMax * sizeof(xmlCharEncodingAlias ));
1069 } 1073 }
1070 /* 1074 /*
1071 * Walk down the list looking for a definition of the alias 1075 * Walk down the list looking for a definition of the alias
1072 */ 1076 */
1073 for (i = 0;i < xmlCharEncodingAliasesNb;i++) { 1077 for (i = 0;i < xmlCharEncodingAliasesNb;i++) {
1074 if (!strcmp(xmlCharEncodingAliases[i].alias, upper)) { 1078 if (!strcmp(xmlCharEncodingAliases[i].alias, upper)) {
1075 /* 1079 /*
1076 * Replace the definition. 1080 * Replace the definition.
(...skipping 10 matching lines...) Expand all
1087 xmlCharEncodingAliases[xmlCharEncodingAliasesNb].alias = xmlMemStrdup(upper) ; 1091 xmlCharEncodingAliases[xmlCharEncodingAliasesNb].alias = xmlMemStrdup(upper) ;
1088 xmlCharEncodingAliasesNb++; 1092 xmlCharEncodingAliasesNb++;
1089 return(0); 1093 return(0);
1090 } 1094 }
1091 1095
1092 /** 1096 /**
1093 * xmlDelEncodingAlias: 1097 * xmlDelEncodingAlias:
1094 * @alias: the alias name as parsed, in UTF-8 format (ASCII actually) 1098 * @alias: the alias name as parsed, in UTF-8 format (ASCII actually)
1095 * 1099 *
1096 * Unregisters an encoding alias @alias 1100 * Unregisters an encoding alias @alias
1097 * 1101 *
1098 * Returns 0 in case of success, -1 in case of error 1102 * Returns 0 in case of success, -1 in case of error
1099 */ 1103 */
1100 int 1104 int
1101 xmlDelEncodingAlias(const char *alias) { 1105 xmlDelEncodingAlias(const char *alias) {
1102 int i; 1106 int i;
1103 1107
1104 if (alias == NULL) 1108 if (alias == NULL)
1105 return(-1); 1109 return(-1);
1106 1110
1107 if (xmlCharEncodingAliases == NULL) 1111 if (xmlCharEncodingAliases == NULL)
(...skipping 14 matching lines...) Expand all
1122 return(-1); 1126 return(-1);
1123 } 1127 }
1124 1128
1125 /** 1129 /**
1126 * xmlParseCharEncoding: 1130 * xmlParseCharEncoding:
1127 * @name: the encoding name as parsed, in UTF-8 format (ASCII actually) 1131 * @name: the encoding name as parsed, in UTF-8 format (ASCII actually)
1128 * 1132 *
1129 * Compare the string to the encoding schemes already known. Note 1133 * Compare the string to the encoding schemes already known. Note
1130 * that the comparison is case insensitive accordingly to the section 1134 * that the comparison is case insensitive accordingly to the section
1131 * [XML] 4.3.3 Character Encoding in Entities. 1135 * [XML] 4.3.3 Character Encoding in Entities.
1132 * 1136 *
1133 * Returns one of the XML_CHAR_ENCODING_... values or XML_CHAR_ENCODING_NONE 1137 * Returns one of the XML_CHAR_ENCODING_... values or XML_CHAR_ENCODING_NONE
1134 * if not recognized. 1138 * if not recognized.
1135 */ 1139 */
1136 xmlCharEncoding 1140 xmlCharEncoding
1137 xmlParseCharEncoding(const char* name) 1141 xmlParseCharEncoding(const char* name)
1138 { 1142 {
1139 const char *alias; 1143 const char *alias;
1140 char upper[500]; 1144 char upper[500];
1141 int i; 1145 int i;
1142 1146
(...skipping 16 matching lines...) Expand all
1159 if (!strcmp(upper, "")) return(XML_CHAR_ENCODING_NONE); 1163 if (!strcmp(upper, "")) return(XML_CHAR_ENCODING_NONE);
1160 if (!strcmp(upper, "UTF-8")) return(XML_CHAR_ENCODING_UTF8); 1164 if (!strcmp(upper, "UTF-8")) return(XML_CHAR_ENCODING_UTF8);
1161 if (!strcmp(upper, "UTF8")) return(XML_CHAR_ENCODING_UTF8); 1165 if (!strcmp(upper, "UTF8")) return(XML_CHAR_ENCODING_UTF8);
1162 1166
1163 /* 1167 /*
1164 * NOTE: if we were able to parse this, the endianness of UTF16 is 1168 * NOTE: if we were able to parse this, the endianness of UTF16 is
1165 * already found and in use 1169 * already found and in use
1166 */ 1170 */
1167 if (!strcmp(upper, "UTF-16")) return(XML_CHAR_ENCODING_UTF16LE); 1171 if (!strcmp(upper, "UTF-16")) return(XML_CHAR_ENCODING_UTF16LE);
1168 if (!strcmp(upper, "UTF16")) return(XML_CHAR_ENCODING_UTF16LE); 1172 if (!strcmp(upper, "UTF16")) return(XML_CHAR_ENCODING_UTF16LE);
1169 1173
1170 if (!strcmp(upper, "ISO-10646-UCS-2")) return(XML_CHAR_ENCODING_UCS2); 1174 if (!strcmp(upper, "ISO-10646-UCS-2")) return(XML_CHAR_ENCODING_UCS2);
1171 if (!strcmp(upper, "UCS-2")) return(XML_CHAR_ENCODING_UCS2); 1175 if (!strcmp(upper, "UCS-2")) return(XML_CHAR_ENCODING_UCS2);
1172 if (!strcmp(upper, "UCS2")) return(XML_CHAR_ENCODING_UCS2); 1176 if (!strcmp(upper, "UCS2")) return(XML_CHAR_ENCODING_UCS2);
1173 1177
1174 /* 1178 /*
1175 * NOTE: if we were able to parse this, the endianness of UCS4 is 1179 * NOTE: if we were able to parse this, the endianness of UCS4 is
1176 * already found and in use 1180 * already found and in use
1177 */ 1181 */
1178 if (!strcmp(upper, "ISO-10646-UCS-4")) return(XML_CHAR_ENCODING_UCS4LE); 1182 if (!strcmp(upper, "ISO-10646-UCS-4")) return(XML_CHAR_ENCODING_UCS4LE);
1179 if (!strcmp(upper, "UCS-4")) return(XML_CHAR_ENCODING_UCS4LE); 1183 if (!strcmp(upper, "UCS-4")) return(XML_CHAR_ENCODING_UCS4LE);
1180 if (!strcmp(upper, "UCS4")) return(XML_CHAR_ENCODING_UCS4LE); 1184 if (!strcmp(upper, "UCS4")) return(XML_CHAR_ENCODING_UCS4LE);
1181 1185
1182 1186
1183 if (!strcmp(upper, "ISO-8859-1")) return(XML_CHAR_ENCODING_8859_1); 1187 if (!strcmp(upper, "ISO-8859-1")) return(XML_CHAR_ENCODING_8859_1);
1184 if (!strcmp(upper, "ISO-LATIN-1")) return(XML_CHAR_ENCODING_8859_1); 1188 if (!strcmp(upper, "ISO-LATIN-1")) return(XML_CHAR_ENCODING_8859_1);
1185 if (!strcmp(upper, "ISO LATIN 1")) return(XML_CHAR_ENCODING_8859_1); 1189 if (!strcmp(upper, "ISO LATIN 1")) return(XML_CHAR_ENCODING_8859_1);
1186 1190
1187 if (!strcmp(upper, "ISO-8859-2")) return(XML_CHAR_ENCODING_8859_2); 1191 if (!strcmp(upper, "ISO-8859-2")) return(XML_CHAR_ENCODING_8859_2);
1188 if (!strcmp(upper, "ISO-LATIN-2")) return(XML_CHAR_ENCODING_8859_2); 1192 if (!strcmp(upper, "ISO-LATIN-2")) return(XML_CHAR_ENCODING_8859_2);
1189 if (!strcmp(upper, "ISO LATIN 2")) return(XML_CHAR_ENCODING_8859_2); 1193 if (!strcmp(upper, "ISO LATIN 2")) return(XML_CHAR_ENCODING_8859_2);
1190 1194
1191 if (!strcmp(upper, "ISO-8859-3")) return(XML_CHAR_ENCODING_8859_3); 1195 if (!strcmp(upper, "ISO-8859-3")) return(XML_CHAR_ENCODING_8859_3);
1192 if (!strcmp(upper, "ISO-8859-4")) return(XML_CHAR_ENCODING_8859_4); 1196 if (!strcmp(upper, "ISO-8859-4")) return(XML_CHAR_ENCODING_8859_4);
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 * xmlNewCharEncodingHandler: 1299 * xmlNewCharEncodingHandler:
1296 * @name: the encoding name, in UTF-8 format (ASCII actually) 1300 * @name: the encoding name, in UTF-8 format (ASCII actually)
1297 * @input: the xmlCharEncodingInputFunc to read that encoding 1301 * @input: the xmlCharEncodingInputFunc to read that encoding
1298 * @output: the xmlCharEncodingOutputFunc to write that encoding 1302 * @output: the xmlCharEncodingOutputFunc to write that encoding
1299 * 1303 *
1300 * Create and registers an xmlCharEncodingHandler. 1304 * Create and registers an xmlCharEncodingHandler.
1301 * 1305 *
1302 * Returns the xmlCharEncodingHandlerPtr created (or NULL in case of error). 1306 * Returns the xmlCharEncodingHandlerPtr created (or NULL in case of error).
1303 */ 1307 */
1304 xmlCharEncodingHandlerPtr 1308 xmlCharEncodingHandlerPtr
1305 xmlNewCharEncodingHandler(const char *name, 1309 xmlNewCharEncodingHandler(const char *name,
1306 xmlCharEncodingInputFunc input, 1310 xmlCharEncodingInputFunc input,
1307 xmlCharEncodingOutputFunc output) { 1311 xmlCharEncodingOutputFunc output) {
1308 xmlCharEncodingHandlerPtr handler; 1312 xmlCharEncodingHandlerPtr handler;
1309 const char *alias; 1313 const char *alias;
1310 char upper[500]; 1314 char upper[500];
1311 int i; 1315 int i;
1312 char *up = NULL; 1316 char *up = NULL;
1313 1317
1314 /* 1318 /*
1315 * Do the alias resolution 1319 * Do the alias resolution
(...skipping 24 matching lines...) Expand all
1340 /* 1344 /*
1341 * allocate and fill-up an handler block. 1345 * allocate and fill-up an handler block.
1342 */ 1346 */
1343 handler = (xmlCharEncodingHandlerPtr) 1347 handler = (xmlCharEncodingHandlerPtr)
1344 xmlMalloc(sizeof(xmlCharEncodingHandler)); 1348 xmlMalloc(sizeof(xmlCharEncodingHandler));
1345 if (handler == NULL) { 1349 if (handler == NULL) {
1346 xmlFree(up); 1350 xmlFree(up);
1347 xmlEncodingErrMemory("xmlNewCharEncodingHandler : out of memory !\n"); 1351 xmlEncodingErrMemory("xmlNewCharEncodingHandler : out of memory !\n");
1348 return(NULL); 1352 return(NULL);
1349 } 1353 }
1354 memset(handler, 0, sizeof(xmlCharEncodingHandler));
1350 handler->input = input; 1355 handler->input = input;
1351 handler->output = output; 1356 handler->output = output;
1352 handler->name = up; 1357 handler->name = up;
1353 1358
1354 #ifdef LIBXML_ICONV_ENABLED 1359 #ifdef LIBXML_ICONV_ENABLED
1355 handler->iconv_in = NULL; 1360 handler->iconv_in = NULL;
1356 handler->iconv_out = NULL; 1361 handler->iconv_out = NULL;
1357 #endif 1362 #endif
1358 #ifdef LIBXML_ICU_ENABLED 1363 #ifdef LIBXML_ICU_ENABLED
1359 handler->uconv_in = NULL; 1364 handler->uconv_in = NULL;
(...skipping 15 matching lines...) Expand all
1375 * xmlInitCharEncodingHandlers: 1380 * xmlInitCharEncodingHandlers:
1376 * 1381 *
1377 * Initialize the char encoding support, it registers the default 1382 * Initialize the char encoding support, it registers the default
1378 * encoding supported. 1383 * encoding supported.
1379 * NOTE: while public, this function usually doesn't need to be called 1384 * NOTE: while public, this function usually doesn't need to be called
1380 * in normal processing. 1385 * in normal processing.
1381 */ 1386 */
1382 void 1387 void
1383 xmlInitCharEncodingHandlers(void) { 1388 xmlInitCharEncodingHandlers(void) {
1384 unsigned short int tst = 0x1234; 1389 unsigned short int tst = 0x1234;
1385 unsigned char *ptr = (unsigned char *) &tst; 1390 unsigned char *ptr = (unsigned char *) &tst;
1386 1391
1387 if (handlers != NULL) return; 1392 if (handlers != NULL) return;
1388 1393
1389 handlers = (xmlCharEncodingHandlerPtr *) 1394 handlers = (xmlCharEncodingHandlerPtr *)
1390 xmlMalloc(MAX_ENCODING_HANDLERS * sizeof(xmlCharEncodingHandlerPtr)); 1395 xmlMalloc(MAX_ENCODING_HANDLERS * sizeof(xmlCharEncodingHandlerPtr));
1391 1396
1392 if (*ptr == 0x12) xmlLittleEndian = 0; 1397 if (*ptr == 0x12) xmlLittleEndian = 0;
1393 else if (*ptr == 0x34) xmlLittleEndian = 1; 1398 else if (*ptr == 0x34) xmlLittleEndian = 1;
1394 else { 1399 else {
1395 xmlEncodingErr(XML_ERR_INTERNAL_ERROR, 1400 xmlEncodingErr(XML_ERR_INTERNAL_ERROR,
1396 "Odd problem at endianness detection\n", NULL); 1401 "Odd problem at endianness detection\n", NULL);
1397 } 1402 }
1398 1403
1399 if (handlers == NULL) { 1404 if (handlers == NULL) {
1400 xmlEncodingErrMemory("xmlInitCharEncodingHandlers : out of memory !\n"); 1405 xmlEncodingErrMemory("xmlInitCharEncodingHandlers : out of memory !\n");
1401 return; 1406 return;
1402 } 1407 }
1403 xmlNewCharEncodingHandler("UTF-8", UTF8ToUTF8, UTF8ToUTF8); 1408 xmlNewCharEncodingHandler("UTF-8", UTF8ToUTF8, UTF8ToUTF8);
1404 #ifdef LIBXML_OUTPUT_ENABLED 1409 #ifdef LIBXML_OUTPUT_ENABLED
1405 xmlUTF16LEHandler = 1410 xmlUTF16LEHandler =
1406 xmlNewCharEncodingHandler("UTF-16LE", UTF16LEToUTF8, UTF8ToUTF16LE); 1411 xmlNewCharEncodingHandler("UTF-16LE", UTF16LEToUTF8, UTF8ToUTF16LE);
1407 xmlUTF16BEHandler = 1412 xmlUTF16BEHandler =
1408 xmlNewCharEncodingHandler("UTF-16BE", UTF16BEToUTF8, UTF8ToUTF16BE); 1413 xmlNewCharEncodingHandler("UTF-16BE", UTF16BEToUTF8, UTF8ToUTF16BE);
1409 xmlNewCharEncodingHandler("UTF-16", UTF16LEToUTF8, UTF8ToUTF16); 1414 xmlNewCharEncodingHandler("UTF-16", UTF16LEToUTF8, UTF8ToUTF16);
1410 xmlNewCharEncodingHandler("ISO-8859-1", isolat1ToUTF8, UTF8Toisolat1); 1415 xmlNewCharEncodingHandler("ISO-8859-1", isolat1ToUTF8, UTF8Toisolat1);
1411 xmlNewCharEncodingHandler("ASCII", asciiToUTF8, UTF8Toascii); 1416 xmlNewCharEncodingHandler("ASCII", asciiToUTF8, UTF8Toascii);
1412 xmlNewCharEncodingHandler("US-ASCII", asciiToUTF8, UTF8Toascii); 1417 xmlNewCharEncodingHandler("US-ASCII", asciiToUTF8, UTF8Toascii);
1413 #ifdef LIBXML_HTML_ENABLED 1418 #ifdef LIBXML_HTML_ENABLED
1414 xmlNewCharEncodingHandler("HTML", NULL, UTF8ToHtml); 1419 xmlNewCharEncodingHandler("HTML", NULL, UTF8ToHtml);
1415 #endif 1420 #endif
1416 #else 1421 #else
1417 xmlUTF16LEHandler = 1422 xmlUTF16LEHandler =
1418 xmlNewCharEncodingHandler("UTF-16LE", UTF16LEToUTF8, NULL); 1423 xmlNewCharEncodingHandler("UTF-16LE", UTF16LEToUTF8, NULL);
1419 xmlUTF16BEHandler = 1424 xmlUTF16BEHandler =
1420 xmlNewCharEncodingHandler("UTF-16BE", UTF16BEToUTF8, NULL); 1425 xmlNewCharEncodingHandler("UTF-16BE", UTF16BEToUTF8, NULL);
1421 xmlNewCharEncodingHandler("UTF-16", UTF16LEToUTF8, NULL); 1426 xmlNewCharEncodingHandler("UTF-16", UTF16LEToUTF8, NULL);
1422 xmlNewCharEncodingHandler("ISO-8859-1", isolat1ToUTF8, NULL); 1427 xmlNewCharEncodingHandler("ISO-8859-1", isolat1ToUTF8, NULL);
1423 xmlNewCharEncodingHandler("ASCII", asciiToUTF8, NULL); 1428 xmlNewCharEncodingHandler("ASCII", asciiToUTF8, NULL);
1424 xmlNewCharEncodingHandler("US-ASCII", asciiToUTF8, NULL); 1429 xmlNewCharEncodingHandler("US-ASCII", asciiToUTF8, NULL);
1425 #endif /* LIBXML_OUTPUT_ENABLED */ 1430 #endif /* LIBXML_OUTPUT_ENABLED */
1426 #if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED) 1431 #if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED)
1427 #ifdef LIBXML_ISO8859X_ENABLED 1432 #ifdef LIBXML_ISO8859X_ENABLED
1428 xmlRegisterCharEncodingHandlersISO8859x (); 1433 xmlRegisterCharEncodingHandlersISO8859x ();
1429 #endif 1434 #endif
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 return(xmlUTF16LEHandler); 1510 return(xmlUTF16LEHandler);
1506 case XML_CHAR_ENCODING_UTF16BE: 1511 case XML_CHAR_ENCODING_UTF16BE:
1507 return(xmlUTF16BEHandler); 1512 return(xmlUTF16BEHandler);
1508 case XML_CHAR_ENCODING_EBCDIC: 1513 case XML_CHAR_ENCODING_EBCDIC:
1509 handler = xmlFindCharEncodingHandler("EBCDIC"); 1514 handler = xmlFindCharEncodingHandler("EBCDIC");
1510 if (handler != NULL) return(handler); 1515 if (handler != NULL) return(handler);
1511 handler = xmlFindCharEncodingHandler("ebcdic"); 1516 handler = xmlFindCharEncodingHandler("ebcdic");
1512 if (handler != NULL) return(handler); 1517 if (handler != NULL) return(handler);
1513 handler = xmlFindCharEncodingHandler("EBCDIC-US"); 1518 handler = xmlFindCharEncodingHandler("EBCDIC-US");
1514 if (handler != NULL) return(handler); 1519 if (handler != NULL) return(handler);
1520 handler = xmlFindCharEncodingHandler("IBM-037");
1521 if (handler != NULL) return(handler);
1515 break; 1522 break;
1516 case XML_CHAR_ENCODING_UCS4BE: 1523 case XML_CHAR_ENCODING_UCS4BE:
1517 handler = xmlFindCharEncodingHandler("ISO-10646-UCS-4"); 1524 handler = xmlFindCharEncodingHandler("ISO-10646-UCS-4");
1518 if (handler != NULL) return(handler); 1525 if (handler != NULL) return(handler);
1519 handler = xmlFindCharEncodingHandler("UCS-4"); 1526 handler = xmlFindCharEncodingHandler("UCS-4");
1520 if (handler != NULL) return(handler); 1527 if (handler != NULL) return(handler);
1521 handler = xmlFindCharEncodingHandler("UCS4"); 1528 handler = xmlFindCharEncodingHandler("UCS4");
1522 if (handler != NULL) return(handler); 1529 if (handler != NULL) return(handler);
1523 break; 1530 break;
1524 case XML_CHAR_ENCODING_UCS4LE: 1531 case XML_CHAR_ENCODING_UCS4LE:
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
1595 if (handler != NULL) return(handler); 1602 if (handler != NULL) return(handler);
1596 handler = xmlFindCharEncodingHandler("SHIFT_JIS"); 1603 handler = xmlFindCharEncodingHandler("SHIFT_JIS");
1597 if (handler != NULL) return(handler); 1604 if (handler != NULL) return(handler);
1598 handler = xmlFindCharEncodingHandler("Shift_JIS"); 1605 handler = xmlFindCharEncodingHandler("Shift_JIS");
1599 if (handler != NULL) return(handler); 1606 if (handler != NULL) return(handler);
1600 break; 1607 break;
1601 case XML_CHAR_ENCODING_EUC_JP: 1608 case XML_CHAR_ENCODING_EUC_JP:
1602 handler = xmlFindCharEncodingHandler("EUC-JP"); 1609 handler = xmlFindCharEncodingHandler("EUC-JP");
1603 if (handler != NULL) return(handler); 1610 if (handler != NULL) return(handler);
1604 break; 1611 break;
1605 » default: 1612 » default:
1606 break; 1613 break;
1607 } 1614 }
1608 1615
1609 #ifdef DEBUG_ENCODING 1616 #ifdef DEBUG_ENCODING
1610 xmlGenericError(xmlGenericErrorContext, 1617 xmlGenericError(xmlGenericErrorContext,
1611 "No handler found for encoding %d\n", enc); 1618 "No handler found for encoding %d\n", enc);
1612 #endif 1619 #endif
1613 return(NULL); 1620 return(NULL);
1614 } 1621 }
1615 1622
1616 /** 1623 /**
1617 * xmlFindCharEncodingHandler: 1624 * xmlFindCharEncodingHandler:
1618 * @name: a string describing the char encoding. 1625 * @name: a string describing the char encoding.
1619 * 1626 *
1620 * Search in the registered set the handler able to read/write that encoding. 1627 * Search in the registered set the handler able to read/write that encoding.
1621 * 1628 *
1622 * Returns the handler or NULL if not found 1629 * Returns the handler or NULL if not found
1623 */ 1630 */
1624 xmlCharEncodingHandlerPtr 1631 xmlCharEncodingHandlerPtr
1625 xmlFindCharEncodingHandler(const char *name) { 1632 xmlFindCharEncodingHandler(const char *name) {
1626 const char *nalias; 1633 const char *nalias;
1627 const char *norig; 1634 const char *norig;
1628 xmlCharEncoding alias; 1635 xmlCharEncoding alias;
1629 #ifdef LIBXML_ICONV_ENABLED 1636 #ifdef LIBXML_ICONV_ENABLED
1630 xmlCharEncodingHandlerPtr enc; 1637 xmlCharEncodingHandlerPtr enc;
1631 iconv_t icv_in, icv_out; 1638 iconv_t icv_in, icv_out;
1632 #endif /* LIBXML_ICONV_ENABLED */ 1639 #endif /* LIBXML_ICONV_ENABLED */
1633 #ifdef LIBXML_ICU_ENABLED 1640 #ifdef LIBXML_ICU_ENABLED
1634 xmlCharEncodingHandlerPtr enc; 1641 xmlCharEncodingHandlerPtr encu;
1635 uconv_t *ucv_in, *ucv_out; 1642 uconv_t *ucv_in, *ucv_out;
1636 #endif /* LIBXML_ICU_ENABLED */ 1643 #endif /* LIBXML_ICU_ENABLED */
1637 char upper[100]; 1644 char upper[100];
1638 int i; 1645 int i;
1639 1646
1640 if (handlers == NULL) xmlInitCharEncodingHandlers(); 1647 if (handlers == NULL) xmlInitCharEncodingHandlers();
1641 if (name == NULL) return(xmlDefaultCharEncodingHandler); 1648 if (name == NULL) return(xmlDefaultCharEncodingHandler);
1642 if (name[0] == 0) return(xmlDefaultCharEncodingHandler); 1649 if (name[0] == 0) return(xmlDefaultCharEncodingHandler);
1643 1650
1644 /* 1651 /*
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1681 icv_out = iconv_open(upper, "UTF-8"); 1688 icv_out = iconv_open(upper, "UTF-8");
1682 } 1689 }
1683 if ((icv_in != (iconv_t) -1) && (icv_out != (iconv_t) -1)) { 1690 if ((icv_in != (iconv_t) -1) && (icv_out != (iconv_t) -1)) {
1684 enc = (xmlCharEncodingHandlerPtr) 1691 enc = (xmlCharEncodingHandlerPtr)
1685 xmlMalloc(sizeof(xmlCharEncodingHandler)); 1692 xmlMalloc(sizeof(xmlCharEncodingHandler));
1686 if (enc == NULL) { 1693 if (enc == NULL) {
1687 iconv_close(icv_in); 1694 iconv_close(icv_in);
1688 iconv_close(icv_out); 1695 iconv_close(icv_out);
1689 return(NULL); 1696 return(NULL);
1690 } 1697 }
1698 memset(enc, 0, sizeof(xmlCharEncodingHandler));
1691 enc->name = xmlMemStrdup(name); 1699 enc->name = xmlMemStrdup(name);
1692 enc->input = NULL; 1700 enc->input = NULL;
1693 enc->output = NULL; 1701 enc->output = NULL;
1694 enc->iconv_in = icv_in; 1702 enc->iconv_in = icv_in;
1695 enc->iconv_out = icv_out; 1703 enc->iconv_out = icv_out;
1696 #ifdef DEBUG_ENCODING 1704 #ifdef DEBUG_ENCODING
1697 xmlGenericError(xmlGenericErrorContext, 1705 xmlGenericError(xmlGenericErrorContext,
1698 "Found iconv handler for encoding %s\n", name); 1706 "Found iconv handler for encoding %s\n", name);
1699 #endif 1707 #endif
1700 return enc; 1708 return enc;
1701 } else if ((icv_in != (iconv_t) -1) || icv_out != (iconv_t) -1) { 1709 } else if ((icv_in != (iconv_t) -1) || icv_out != (iconv_t) -1) {
1702 xmlEncodingErr(XML_ERR_INTERNAL_ERROR, 1710 xmlEncodingErr(XML_ERR_INTERNAL_ERROR,
1703 "iconv : problems with filters for '%s'\n", name); 1711 "iconv : problems with filters for '%s'\n", name);
1704 } 1712 }
1705 #endif /* LIBXML_ICONV_ENABLED */ 1713 #endif /* LIBXML_ICONV_ENABLED */
1706 #ifdef LIBXML_ICU_ENABLED 1714 #ifdef LIBXML_ICU_ENABLED
1707 /* check whether icu can handle this */ 1715 /* check whether icu can handle this */
1708 ucv_in = openIcuConverter(name, 1); 1716 ucv_in = openIcuConverter(name, 1);
1709 ucv_out = openIcuConverter(name, 0); 1717 ucv_out = openIcuConverter(name, 0);
1710 if (ucv_in != NULL && ucv_out != NULL) { 1718 if (ucv_in != NULL && ucv_out != NULL) {
1711 » enc = (xmlCharEncodingHandlerPtr) 1719 » encu = (xmlCharEncodingHandlerPtr)
1712 » xmlMalloc(sizeof(xmlCharEncodingHandler)); 1720 » xmlMalloc(sizeof(xmlCharEncodingHandler));
1713 » if (enc == NULL) { 1721 » if (encu == NULL) {
1714 closeIcuConverter(ucv_in); 1722 closeIcuConverter(ucv_in);
1715 closeIcuConverter(ucv_out); 1723 closeIcuConverter(ucv_out);
1716 return(NULL); 1724 return(NULL);
1717 } 1725 }
1718 » enc->name = xmlMemStrdup(name); 1726 memset(encu, 0, sizeof(xmlCharEncodingHandler));
1719 » enc->input = NULL; 1727 » encu->name = xmlMemStrdup(name);
1720 » enc->output = NULL; 1728 » encu->input = NULL;
1721 » enc->uconv_in = ucv_in; 1729 » encu->output = NULL;
1722 » enc->uconv_out = ucv_out; 1730 » encu->uconv_in = ucv_in;
1731 » encu->uconv_out = ucv_out;
1723 #ifdef DEBUG_ENCODING 1732 #ifdef DEBUG_ENCODING
1724 xmlGenericError(xmlGenericErrorContext, 1733 xmlGenericError(xmlGenericErrorContext,
1725 "Found ICU converter handler for encoding %s\n", name); 1734 "Found ICU converter handler for encoding %s\n", name);
1726 #endif 1735 #endif
1727 » return enc; 1736 » return encu;
1728 } else if (ucv_in != NULL || ucv_out != NULL) { 1737 } else if (ucv_in != NULL || ucv_out != NULL) {
1729 closeIcuConverter(ucv_in); 1738 closeIcuConverter(ucv_in);
1730 closeIcuConverter(ucv_out); 1739 closeIcuConverter(ucv_out);
1731 xmlEncodingErr(XML_ERR_INTERNAL_ERROR, 1740 xmlEncodingErr(XML_ERR_INTERNAL_ERROR,
1732 "ICU converter : problems with filters for '%s'\n", name); 1741 "ICU converter : problems with filters for '%s'\n", name);
1733 } 1742 }
1734 #endif /* LIBXML_ICU_ENABLED */ 1743 #endif /* LIBXML_ICU_ENABLED */
1735 1744
1736 #ifdef DEBUG_ENCODING 1745 #ifdef DEBUG_ENCODING
1737 xmlGenericError(xmlGenericErrorContext, 1746 xmlGenericError(xmlGenericErrorContext,
(...skipping 24 matching lines...) Expand all
1762 1771
1763 #ifdef LIBXML_ICONV_ENABLED 1772 #ifdef LIBXML_ICONV_ENABLED
1764 /** 1773 /**
1765 * xmlIconvWrapper: 1774 * xmlIconvWrapper:
1766 * @cd: iconv converter data structure 1775 * @cd: iconv converter data structure
1767 * @out: a pointer to an array of bytes to store the result 1776 * @out: a pointer to an array of bytes to store the result
1768 * @outlen: the length of @out 1777 * @outlen: the length of @out
1769 * @in: a pointer to an array of ISO Latin 1 chars 1778 * @in: a pointer to an array of ISO Latin 1 chars
1770 * @inlen: the length of @in 1779 * @inlen: the length of @in
1771 * 1780 *
1772 * Returns 0 if success, or 1781 * Returns 0 if success, or
1773 * -1 by lack of space, or 1782 * -1 by lack of space, or
1774 * -2 if the transcoding fails (for *in is not valid utf8 string or 1783 * -2 if the transcoding fails (for *in is not valid utf8 string or
1775 * the result of transformation can't fit into the encoding we want), or 1784 * the result of transformation can't fit into the encoding we want), or
1776 * -3 if there the last byte can't form a single output char. 1785 * -3 if there the last byte can't form a single output char.
1777 * 1786 *
1778 * The value of @inlen after return is the number of octets consumed 1787 * The value of @inlen after return is the number of octets consumed
1779 * as the return value is positive, else unpredictable. 1788 * as the return value is positive, else unpredictable.
1780 * The value of @outlen after return is the number of ocetes consumed. 1789 * The value of @outlen after return is the number of ocetes consumed.
1781 */ 1790 */
1782 static int 1791 static int
1783 xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen, 1792 xmlIconvWrapper(iconv_t cd, unsigned char *out, int *outlen,
1784 const unsigned char *in, int *inlen) { 1793 const unsigned char *in, int *inlen) {
1785 size_t icv_inlen, icv_outlen; 1794 size_t icv_inlen, icv_outlen;
1786 const char *icv_in = (const char *) in; 1795 const char *icv_in = (const char *) in;
1787 char *icv_out = (char *) out; 1796 char *icv_out = (char *) out;
(...skipping 27 matching lines...) Expand all
1815 { 1824 {
1816 return -3; 1825 return -3;
1817 } 1826 }
1818 } 1827 }
1819 return 0; 1828 return 0;
1820 } 1829 }
1821 #endif /* LIBXML_ICONV_ENABLED */ 1830 #endif /* LIBXML_ICONV_ENABLED */
1822 1831
1823 /************************************************************************ 1832 /************************************************************************
1824 * * 1833 * *
1825 *» » ICU based generic conversion functions» » * 1834 *» » ICU based generic conversion functions» » *
1826 * * 1835 * *
1827 ************************************************************************/ 1836 ************************************************************************/
1828 1837
1829 #ifdef LIBXML_ICU_ENABLED 1838 #ifdef LIBXML_ICU_ENABLED
1830 /** 1839 /**
1831 * xmlUconvWrapper: 1840 * xmlUconvWrapper:
1832 * @cd: ICU uconverter data structure 1841 * @cd: ICU uconverter data structure
1833 * @toUnicode : non-zero if toUnicode. 0 otherwise. 1842 * @toUnicode : non-zero if toUnicode. 0 otherwise.
1834 * @out: a pointer to an array of bytes to store the result 1843 * @out: a pointer to an array of bytes to store the result
1835 * @outlen: the length of @out 1844 * @outlen: the length of @out
1836 * @in: a pointer to an array of ISO Latin 1 chars 1845 * @in: a pointer to an array of ISO Latin 1 chars
1837 * @inlen: the length of @in 1846 * @inlen: the length of @in
1838 * 1847 *
1839 * Returns 0 if success, or 1848 * Returns 0 if success, or
1840 * -1 by lack of space, or 1849 * -1 by lack of space, or
1841 * -2 if the transcoding fails (for *in is not valid utf8 string or 1850 * -2 if the transcoding fails (for *in is not valid utf8 string or
1842 * the result of transformation can't fit into the encoding we want), or 1851 * the result of transformation can't fit into the encoding we want), or
1843 * -3 if there the last byte can't form a single output char. 1852 * -3 if there the last byte can't form a single output char.
1844 * 1853 *
1845 * The value of @inlen after return is the number of octets consumed 1854 * The value of @inlen after return is the number of octets consumed
1846 * as the return value is positive, else unpredictable. 1855 * as the return value is positive, else unpredictable.
1847 * The value of @outlen after return is the number of ocetes consumed. 1856 * The value of @outlen after return is the number of ocetes consumed.
1848 */ 1857 */
1849 static int 1858 static int
1850 xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen, 1859 xmlUconvWrapper(uconv_t *cd, int toUnicode, unsigned char *out, int *outlen,
1851 const unsigned char *in, int *inlen) { 1860 const unsigned char *in, int *inlen) {
1852 const char *ucv_in = (const char *) in; 1861 const char *ucv_in = (const char *) in;
1853 char *ucv_out = (char *) out; 1862 char *ucv_out = (char *) out;
1854 UErrorCode err = U_ZERO_ERROR; 1863 UErrorCode err = U_ZERO_ERROR;
1855 1864
1856 if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) { 1865 if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || (in == NULL)) {
1857 if (outlen != NULL) *outlen = 0; 1866 if (outlen != NULL) *outlen = 0;
1858 return(-1); 1867 return(-1);
1859 } 1868 }
1860 1869
1861 /* 1870 /*
1862 * TODO(jungshik) 1871 * TODO(jungshik)
1863 * 1. is ucnv_convert(To|From)Algorithmic better? 1872 * 1. is ucnv_convert(To|From)Algorithmic better?
1864 * 2. had we better use an explicit pivot buffer? 1873 * 2. had we better use an explicit pivot buffer?
1865 * 3. error returned comes from 'fromUnicode' only even 1874 * 3. error returned comes from 'fromUnicode' only even
1866 * when toUnicode is true ! 1875 * when toUnicode is true !
1867 */ 1876 */
1868 if (toUnicode) { 1877 if (toUnicode) {
1869 /* encoding => UTF-16 => UTF-8 */ 1878 /* encoding => UTF-16 => UTF-8 */
1870 ucnv_convertEx(cd->utf8, cd->uconv, &ucv_out, ucv_out + *outlen, 1879 ucnv_convertEx(cd->utf8, cd->uconv, &ucv_out, ucv_out + *outlen,
1871 &ucv_in, ucv_in + *inlen, NULL, NULL, NULL, NULL, 1880 &ucv_in, ucv_in + *inlen, NULL, NULL, NULL, NULL,
1872 0, TRUE, &err); 1881 0, TRUE, &err);
1873 } else { 1882 } else {
1874 /* UTF-8 => UTF-16 => encoding */ 1883 /* UTF-8 => UTF-16 => encoding */
1875 ucnv_convertEx(cd->uconv, cd->utf8, &ucv_out, ucv_out + *outlen, 1884 ucnv_convertEx(cd->uconv, cd->utf8, &ucv_out, ucv_out + *outlen,
1876 &ucv_in, ucv_in + *inlen, NULL, NULL, NULL, NULL, 1885 &ucv_in, ucv_in + *inlen, NULL, NULL, NULL, NULL,
1877 0, TRUE, &err); 1886 0, TRUE, &err);
1878 } 1887 }
1879 *inlen = ucv_in - (const char*) in; 1888 *inlen = ucv_in - (const char*) in;
1880 *outlen = ucv_out - (char *) out; 1889 *outlen = ucv_out - (char *) out;
1881 if (U_SUCCESS(err)) 1890 if (U_SUCCESS(err))
1882 return 0; 1891 return 0;
1883 if (err == U_BUFFER_OVERFLOW_ERROR) 1892 if (err == U_BUFFER_OVERFLOW_ERROR)
1884 return -1; 1893 return -1;
1885 if (err == U_INVALID_CHAR_FOUND || err == U_ILLEGAL_CHAR_FOUND) 1894 if (err == U_INVALID_CHAR_FOUND || err == U_ILLEGAL_CHAR_FOUND)
1886 return -2; 1895 return -2;
1887 /* if (err == U_TRUNCATED_CHAR_FOUND) */ 1896 /* if (err == U_TRUNCATED_CHAR_FOUND) */
1888 return -3; 1897 return -3;
1889 } 1898 }
1890 #endif /* LIBXML_ICU_ENABLED */ 1899 #endif /* LIBXML_ICU_ENABLED */
1891 1900
1892 /************************************************************************ 1901 /************************************************************************
1893 * * 1902 * *
1894 * The real API used by libxml for on-the-fly conversion * 1903 * The real API used by libxml for on-the-fly conversion *
1895 * * 1904 * *
1896 ************************************************************************/ 1905 ************************************************************************/
1897 int
1898 xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out,
1899 xmlBufferPtr in, int len);
1900 1906
1901 /** 1907 /**
1902 * xmlCharEncFirstLineInt: 1908 * xmlCharEncFirstLineInt:
1903 * @handler: char enconding transformation data structure 1909 * @handler: char enconding transformation data structure
1904 * @out: an xmlBuffer for the output. 1910 * @out: an xmlBuffer for the output.
1905 * @in: an xmlBuffer for the input 1911 * @in: an xmlBuffer for the input
1906 * @len: number of bytes to convert for the first line, or -1 1912 * @len: number of bytes to convert for the first line, or -1
1907 * 1913 *
1908 * Front-end for the encoding handler input function, but handle only 1914 * Front-end for the encoding handler input function, but handle only
1909 * the very first line, i.e. limit itself to 45 chars. 1915 * the very first line, i.e. limit itself to 45 chars.
1910 * 1916 *
1911 * Returns the number of byte written if success, or 1917 * Returns the number of byte written if success, or
1912 * -1 general error 1918 * -1 general error
1913 * -2 if the transcoding fails (for *in is not valid utf8 string or 1919 * -2 if the transcoding fails (for *in is not valid utf8 string or
1914 * the result of transformation can't fit into the encoding we want), or 1920 * the result of transformation can't fit into the encoding we want), or
1915 */ 1921 */
1916 int 1922 int
1917 xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out, 1923 xmlCharEncFirstLineInt(xmlCharEncodingHandler *handler, xmlBufferPtr out,
1918 xmlBufferPtr in, int len) { 1924 xmlBufferPtr in, int len) {
1919 int ret = -2; 1925 int ret = -2;
1920 int written; 1926 int written;
1921 int toconv; 1927 int toconv;
1922 1928
1923 if (handler == NULL) return(-1); 1929 if (handler == NULL) return(-1);
1924 if (out == NULL) return(-1); 1930 if (out == NULL) return(-1);
1925 if (in == NULL) return(-1); 1931 if (in == NULL) return(-1);
1926 1932
1927 /* calculate space available */ 1933 /* calculate space available */
1928 written = out->size - out->use; 1934 written = out->size - out->use - 1; /* count '\0' */
1929 toconv = in->use; 1935 toconv = in->use;
1930 /* 1936 /*
1931 * echo '<?xml version="1.0" encoding="UCS4"?>' | wc -c => 38 1937 * echo '<?xml version="1.0" encoding="UCS4"?>' | wc -c => 38
1932 * 45 chars should be sufficient to reach the end of the encoding 1938 * 45 chars should be sufficient to reach the end of the encoding
1933 * declaration without going too far inside the document content. 1939 * declaration without going too far inside the document content.
1934 * on UTF-16 this means 90bytes, on UCS4 this means 180 1940 * on UTF-16 this means 90bytes, on UCS4 this means 180
1935 * The actual value depending on guessed encoding is passed as @len 1941 * The actual value depending on guessed encoding is passed as @len
1936 * if provided 1942 * if provided
1937 */ 1943 */
1938 if (len >= 0) { 1944 if (len >= 0) {
1939 if (toconv > len) 1945 if (toconv > len)
1940 toconv = len; 1946 toconv = len;
1941 } else { 1947 } else {
1942 if (toconv > 180) 1948 if (toconv > 180)
1943 toconv = 180; 1949 toconv = 180;
1944 } 1950 }
1945 if (toconv * 2 >= written) { 1951 if (toconv * 2 >= written) {
1946 xmlBufferGrow(out, toconv); 1952 xmlBufferGrow(out, toconv * 2);
1947 written = out->size - out->use - 1; 1953 written = out->size - out->use - 1;
1948 } 1954 }
1949 1955
1950 if (handler->input != NULL) { 1956 if (handler->input != NULL) {
1951 ret = handler->input(&out->content[out->use], &written, 1957 ret = handler->input(&out->content[out->use], &written,
1952 in->content, &toconv); 1958 in->content, &toconv);
1953 xmlBufferShrink(in, toconv); 1959 xmlBufferShrink(in, toconv);
1954 out->use += written; 1960 out->use += written;
1955 out->content[out->use] = 0; 1961 out->content[out->use] = 0;
1956 } 1962 }
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
2019 * -2 if the transcoding fails (for *in is not valid utf8 string or 2025 * -2 if the transcoding fails (for *in is not valid utf8 string or
2020 * the result of transformation can't fit into the encoding we want), or 2026 * the result of transformation can't fit into the encoding we want), or
2021 */ 2027 */
2022 int 2028 int
2023 xmlCharEncFirstLine(xmlCharEncodingHandler *handler, xmlBufferPtr out, 2029 xmlCharEncFirstLine(xmlCharEncodingHandler *handler, xmlBufferPtr out,
2024 xmlBufferPtr in) { 2030 xmlBufferPtr in) {
2025 return(xmlCharEncFirstLineInt(handler, out, in, -1)); 2031 return(xmlCharEncFirstLineInt(handler, out, in, -1));
2026 } 2032 }
2027 2033
2028 /** 2034 /**
2035 * xmlCharEncFirstLineInput:
2036 * @input: a parser input buffer
2037 * @len: number of bytes to convert for the first line, or -1
2038 *
2039 * Front-end for the encoding handler input function, but handle only
2040 * the very first line. Point is that this is based on autodetection
2041 * of the encoding and once that first line is converted we may find
2042 * out that a different decoder is needed to process the input.
2043 *
2044 * Returns the number of byte written if success, or
2045 * -1 general error
2046 * -2 if the transcoding fails (for *in is not valid utf8 string or
2047 * the result of transformation can't fit into the encoding we want), or
2048 */
2049 int
2050 xmlCharEncFirstLineInput(xmlParserInputBufferPtr input, int len)
2051 {
2052 int ret = -2;
2053 size_t written;
2054 size_t toconv;
2055 int c_in;
2056 int c_out;
2057 xmlBufPtr in;
2058 xmlBufPtr out;
2059
2060 if ((input == NULL) || (input->encoder == NULL) ||
2061 (input->buffer == NULL) || (input->raw == NULL))
2062 return (-1);
2063 out = input->buffer;
2064 in = input->raw;
2065
2066 toconv = xmlBufUse(in);
2067 if (toconv == 0)
2068 return (0);
2069 written = xmlBufAvail(out) - 1; /* count '\0' */
2070 /*
2071 * echo '<?xml version="1.0" encoding="UCS4"?>' | wc -c => 38
2072 * 45 chars should be sufficient to reach the end of the encoding
2073 * declaration without going too far inside the document content.
2074 * on UTF-16 this means 90bytes, on UCS4 this means 180
2075 * The actual value depending on guessed encoding is passed as @len
2076 * if provided
2077 */
2078 if (len >= 0) {
2079 if (toconv > (unsigned int) len)
2080 toconv = len;
2081 } else {
2082 if (toconv > 180)
2083 toconv = 180;
2084 }
2085 if (toconv * 2 >= written) {
2086 xmlBufGrow(out, toconv * 2);
2087 written = xmlBufAvail(out) - 1;
2088 }
2089 if (written > 360)
2090 written = 360;
2091
2092 c_in = toconv;
2093 c_out = written;
2094 if (input->encoder->input != NULL) {
2095 ret = input->encoder->input(xmlBufEnd(out), &c_out,
2096 xmlBufContent(in), &c_in);
2097 xmlBufShrink(in, c_in);
2098 xmlBufAddLen(out, c_out);
2099 }
2100 #ifdef LIBXML_ICONV_ENABLED
2101 else if (input->encoder->iconv_in != NULL) {
2102 ret = xmlIconvWrapper(input->encoder->iconv_in, xmlBufEnd(out),
2103 &c_out, xmlBufContent(in), &c_in);
2104 xmlBufShrink(in, c_in);
2105 xmlBufAddLen(out, c_out);
2106 if (ret == -1)
2107 ret = -3;
2108 }
2109 #endif /* LIBXML_ICONV_ENABLED */
2110 #ifdef LIBXML_ICU_ENABLED
2111 else if (input->encoder->uconv_in != NULL) {
2112 ret = xmlUconvWrapper(input->encoder->uconv_in, 1, xmlBufEnd(out),
2113 &c_out, xmlBufContent(in), &c_in);
2114 xmlBufShrink(in, c_in);
2115 xmlBufAddLen(out, c_out);
2116 if (ret == -1)
2117 ret = -3;
2118 }
2119 #endif /* LIBXML_ICU_ENABLED */
2120 switch (ret) {
2121 case 0:
2122 #ifdef DEBUG_ENCODING
2123 xmlGenericError(xmlGenericErrorContext,
2124 "converted %d bytes to %d bytes of input\n",
2125 c_in, c_out);
2126 #endif
2127 break;
2128 case -1:
2129 #ifdef DEBUG_ENCODING
2130 xmlGenericError(xmlGenericErrorContext,
2131 "converted %d bytes to %d bytes of input, %d left\n",
2132 c_in, c_out, (int)xmlBufUse(in));
2133 #endif
2134 break;
2135 case -3:
2136 #ifdef DEBUG_ENCODING
2137 xmlGenericError(xmlGenericErrorContext,
2138 "converted %d bytes to %d bytes of input, %d left\n",
2139 c_in, c_out, (int)xmlBufUse(in));
2140 #endif
2141 break;
2142 case -2: {
2143 char buf[50];
2144 const xmlChar *content = xmlBufContent(in);
2145
2146 snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X",
2147 content[0], content[1],
2148 content[2], content[3]);
2149 buf[49] = 0;
2150 xmlEncodingErr(XML_I18N_CONV_FAILED,
2151 "input conversion failed due to input error, bytes %s\n",
2152 buf);
2153 }
2154 }
2155 /*
2156 * Ignore when input buffer is not on a boundary
2157 */
2158 if (ret == -3) ret = 0;
2159 if (ret == -1) ret = 0;
2160 return(ret);
2161 }
2162
2163 /**
2164 * xmlCharEncInput:
2165 * @input: a parser input buffer
2166 * @flush: try to flush all the raw buffer
2167 *
2168 * Generic front-end for the encoding handler on parser input
2169 *
2170 * Returns the number of byte written if success, or
2171 * -1 general error
2172 * -2 if the transcoding fails (for *in is not valid utf8 string or
2173 * the result of transformation can't fit into the encoding we want), or
2174 */
2175 int
2176 xmlCharEncInput(xmlParserInputBufferPtr input, int flush)
2177 {
2178 int ret = -2;
2179 size_t written;
2180 size_t toconv;
2181 int c_in;
2182 int c_out;
2183 xmlBufPtr in;
2184 xmlBufPtr out;
2185
2186 if ((input == NULL) || (input->encoder == NULL) ||
2187 (input->buffer == NULL) || (input->raw == NULL))
2188 return (-1);
2189 out = input->buffer;
2190 in = input->raw;
2191
2192 toconv = xmlBufUse(in);
2193 if (toconv == 0)
2194 return (0);
2195 if ((toconv > 64 * 1024) && (flush == 0))
2196 toconv = 64 * 1024;
2197 written = xmlBufAvail(out);
2198 if (written > 0)
2199 written--; /* count '\0' */
2200 if (toconv * 2 >= written) {
2201 xmlBufGrow(out, toconv * 2);
2202 written = xmlBufAvail(out);
2203 if (written > 0)
2204 written--; /* count '\0' */
2205 }
2206 if ((written > 128 * 1024) && (flush == 0))
2207 written = 128 * 1024;
2208
2209 c_in = toconv;
2210 c_out = written;
2211 if (input->encoder->input != NULL) {
2212 ret = input->encoder->input(xmlBufEnd(out), &c_out,
2213 xmlBufContent(in), &c_in);
2214 xmlBufShrink(in, c_in);
2215 xmlBufAddLen(out, c_out);
2216 }
2217 #ifdef LIBXML_ICONV_ENABLED
2218 else if (input->encoder->iconv_in != NULL) {
2219 ret = xmlIconvWrapper(input->encoder->iconv_in, xmlBufEnd(out),
2220 &c_out, xmlBufContent(in), &c_in);
2221 xmlBufShrink(in, c_in);
2222 xmlBufAddLen(out, c_out);
2223 if (ret == -1)
2224 ret = -3;
2225 }
2226 #endif /* LIBXML_ICONV_ENABLED */
2227 #ifdef LIBXML_ICU_ENABLED
2228 else if (input->encoder->uconv_in != NULL) {
2229 ret = xmlUconvWrapper(input->encoder->uconv_in, 1, xmlBufEnd(out),
2230 &c_out, xmlBufContent(in), &c_in);
2231 xmlBufShrink(in, c_in);
2232 xmlBufAddLen(out, c_out);
2233 if (ret == -1)
2234 ret = -3;
2235 }
2236 #endif /* LIBXML_ICU_ENABLED */
2237 switch (ret) {
2238 case 0:
2239 #ifdef DEBUG_ENCODING
2240 xmlGenericError(xmlGenericErrorContext,
2241 "converted %d bytes to %d bytes of input\n",
2242 c_in, c_out);
2243 #endif
2244 break;
2245 case -1:
2246 #ifdef DEBUG_ENCODING
2247 xmlGenericError(xmlGenericErrorContext,
2248 "converted %d bytes to %d bytes of input, %d left\n",
2249 c_in, c_out, (int)xmlBufUse(in));
2250 #endif
2251 break;
2252 case -3:
2253 #ifdef DEBUG_ENCODING
2254 xmlGenericError(xmlGenericErrorContext,
2255 "converted %d bytes to %d bytes of input, %d left\n",
2256 c_in, c_out, (int)xmlBufUse(in));
2257 #endif
2258 break;
2259 case -2: {
2260 char buf[50];
2261 const xmlChar *content = xmlBufContent(in);
2262
2263 snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X",
2264 content[0], content[1],
2265 content[2], content[3]);
2266 buf[49] = 0;
2267 xmlEncodingErr(XML_I18N_CONV_FAILED,
2268 "input conversion failed due to input error, bytes %s\n",
2269 buf);
2270 }
2271 }
2272 /*
2273 * Ignore when input buffer is not on a boundary
2274 */
2275 if (ret == -3)
2276 ret = 0;
2277 return (c_out? c_out : ret);
2278 }
2279
2280 /**
2029 * xmlCharEncInFunc: 2281 * xmlCharEncInFunc:
2030 * @handler: char encoding transformation data structure 2282 * @handler: char encoding transformation data structure
2031 * @out: an xmlBuffer for the output. 2283 * @out: an xmlBuffer for the output.
2032 * @in: an xmlBuffer for the input 2284 * @in: an xmlBuffer for the input
2033 * 2285 *
2034 * Generic front-end for the encoding handler input function 2286 * Generic front-end for the encoding handler input function
2035 * 2287 *
2036 * Returns the number of byte written if success, or 2288 * Returns the number of byte written if success, or
2037 * -1 general error 2289 * -1 general error
2038 * -2 if the transcoding fails (for *in is not valid utf8 string or 2290 * -2 if the transcoding fails (for *in is not valid utf8 string or
(...skipping 10 matching lines...) Expand all
2049 if (handler == NULL) 2301 if (handler == NULL)
2050 return (-1); 2302 return (-1);
2051 if (out == NULL) 2303 if (out == NULL)
2052 return (-1); 2304 return (-1);
2053 if (in == NULL) 2305 if (in == NULL)
2054 return (-1); 2306 return (-1);
2055 2307
2056 toconv = in->use; 2308 toconv = in->use;
2057 if (toconv == 0) 2309 if (toconv == 0)
2058 return (0); 2310 return (0);
2059 written = out->size - out->use; 2311 written = out->size - out->use -1; /* count '\0' */
2060 if (toconv * 2 >= written) { 2312 if (toconv * 2 >= written) {
2061 xmlBufferGrow(out, out->size + toconv * 2); 2313 xmlBufferGrow(out, out->size + toconv * 2);
2062 written = out->size - out->use - 1; 2314 written = out->size - out->use - 1;
2063 } 2315 }
2064 if (handler->input != NULL) { 2316 if (handler->input != NULL) {
2065 ret = handler->input(&out->content[out->use], &written, 2317 ret = handler->input(&out->content[out->use], &written,
2066 in->content, &toconv); 2318 in->content, &toconv);
2067 xmlBufferShrink(in, toconv); 2319 xmlBufferShrink(in, toconv);
2068 out->use += written; 2320 out->use += written;
2069 out->content[out->use] = 0; 2321 out->content[out->use] = 0;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
2108 case -3: 2360 case -3:
2109 #ifdef DEBUG_ENCODING 2361 #ifdef DEBUG_ENCODING
2110 xmlGenericError(xmlGenericErrorContext, 2362 xmlGenericError(xmlGenericErrorContext,
2111 "converted %d bytes to %d bytes of input, %d left\n", 2363 "converted %d bytes to %d bytes of input, %d left\n",
2112 toconv, written, in->use); 2364 toconv, written, in->use);
2113 #endif 2365 #endif
2114 break; 2366 break;
2115 case -2: { 2367 case -2: {
2116 char buf[50]; 2368 char buf[50];
2117 2369
2118 » snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X", 2370 » snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X",
2119 in->content[0], in->content[1], 2371 in->content[0], in->content[1],
2120 in->content[2], in->content[3]); 2372 in->content[2], in->content[3]);
2121 buf[49] = 0; 2373 buf[49] = 0;
2122 xmlEncodingErr(XML_I18N_CONV_FAILED, 2374 xmlEncodingErr(XML_I18N_CONV_FAILED,
2123 "input conversion failed due to input error, bytes %s\n", 2375 "input conversion failed due to input error, bytes %s\n",
2124 buf); 2376 buf);
2125 } 2377 }
2126 } 2378 }
2127 /* 2379 /*
2128 * Ignore when input buffer is not on a boundary 2380 * Ignore when input buffer is not on a boundary
2129 */ 2381 */
2130 if (ret == -3) 2382 if (ret == -3)
2131 ret = 0; 2383 ret = 0;
2132 return (written? written : ret); 2384 return (written? written : ret);
2133 } 2385 }
2134 2386
2387 #ifdef LIBXML_OUTPUT_ENABLED
2388 /**
2389 * xmlCharEncOutput:
2390 * @output: a parser output buffer
2391 * @init: is this an initialization call without data
2392 *
2393 * Generic front-end for the encoding handler on parser output
2394 * a first call with @init == 1 has to be made first to initiate the
2395 * output in case of non-stateless encoding needing to initiate their
2396 * state or the output (like the BOM in UTF16).
2397 * In case of UTF8 sequence conversion errors for the given encoder,
2398 * the content will be automatically remapped to a CharRef sequence.
2399 *
2400 * Returns the number of byte written if success, or
2401 * -1 general error
2402 * -2 if the transcoding fails (for *in is not valid utf8 string or
2403 * the result of transformation can't fit into the encoding we want), or
2404 */
2405 int
2406 xmlCharEncOutput(xmlOutputBufferPtr output, int init)
2407 {
2408 int ret = -2;
2409 size_t written;
2410 size_t writtentot = 0;
2411 size_t toconv;
2412 int c_in;
2413 int c_out;
2414 xmlBufPtr in;
2415 xmlBufPtr out;
2416 int charref_len = 0;
2417
2418 if ((output == NULL) || (output->encoder == NULL) ||
2419 (output->buffer == NULL) || (output->conv == NULL))
2420 return (-1);
2421 out = output->conv;
2422 in = output->buffer;
2423
2424 retry:
2425
2426 written = xmlBufAvail(out);
2427 if (written > 0)
2428 written--; /* count '\0' */
2429
2430 /*
2431 * First specific handling of the initialization call
2432 */
2433 if (init) {
2434 c_in = 0;
2435 c_out = written;
2436 if (output->encoder->output != NULL) {
2437 ret = output->encoder->output(xmlBufEnd(out), &c_out,
2438 NULL, &c_in);
2439 if (ret > 0) /* Gennady: check return value */
2440 xmlBufAddLen(out, c_out);
2441 }
2442 #ifdef LIBXML_ICONV_ENABLED
2443 else if (output->encoder->iconv_out != NULL) {
2444 ret = xmlIconvWrapper(output->encoder->iconv_out, xmlBufEnd(out),
2445 &c_out, NULL, &c_in);
2446 xmlBufAddLen(out, c_out);
2447 }
2448 #endif /* LIBXML_ICONV_ENABLED */
2449 #ifdef LIBXML_ICU_ENABLED
2450 else if (output->encoder->uconv_out != NULL) {
2451 ret = xmlUconvWrapper(output->encoder->uconv_out, 0, xmlBufEnd(out),
2452 &c_out, NULL, &c_in);
2453 xmlBufAddLen(out, c_out);
2454 }
2455 #endif /* LIBXML_ICU_ENABLED */
2456 #ifdef DEBUG_ENCODING
2457 xmlGenericError(xmlGenericErrorContext,
2458 "initialized encoder\n");
2459 #endif
2460 return(0);
2461 }
2462
2463 /*
2464 * Conversion itself.
2465 */
2466 toconv = xmlBufUse(in);
2467 if (toconv == 0)
2468 return (0);
2469 if (toconv > 64 * 1024)
2470 toconv = 64 * 1024;
2471 if (toconv * 4 >= written) {
2472 xmlBufGrow(out, toconv * 4);
2473 written = xmlBufAvail(out) - 1;
2474 }
2475 if (written > 256 * 1024)
2476 written = 256 * 1024;
2477
2478 c_in = toconv;
2479 c_out = written;
2480 if (output->encoder->output != NULL) {
2481 ret = output->encoder->output(xmlBufEnd(out), &c_out,
2482 xmlBufContent(in), &c_in);
2483 if (c_out > 0) {
2484 xmlBufShrink(in, c_in);
2485 xmlBufAddLen(out, c_out);
2486 writtentot += c_out;
2487 }
2488 }
2489 #ifdef LIBXML_ICONV_ENABLED
2490 else if (output->encoder->iconv_out != NULL) {
2491 ret = xmlIconvWrapper(output->encoder->iconv_out, xmlBufEnd(out),
2492 &c_out, xmlBufContent(in), &c_in);
2493 xmlBufShrink(in, c_in);
2494 xmlBufAddLen(out, c_out);
2495 writtentot += c_out;
2496 if (ret == -1) {
2497 if (c_out > 0) {
2498 /*
2499 * Can be a limitation of iconv
2500 */
2501 charref_len = 0;
2502 goto retry;
2503 }
2504 ret = -3;
2505 }
2506 }
2507 #endif /* LIBXML_ICONV_ENABLED */
2508 #ifdef LIBXML_ICU_ENABLED
2509 else if (output->encoder->uconv_out != NULL) {
2510 ret = xmlUconvWrapper(output->encoder->uconv_out, 0, xmlBufEnd(out),
2511 &c_out, xmlBufContent(in), &c_in);
2512 xmlBufShrink(in, c_in);
2513 xmlBufAddLen(out, c_out);
2514 writtentot += c_out;
2515 if (ret == -1) {
2516 if (c_out > 0) {
2517 /*
2518 * Can be a limitation of uconv
2519 */
2520 charref_len = 0;
2521 goto retry;
2522 }
2523 ret = -3;
2524 }
2525 }
2526 #endif /* LIBXML_ICU_ENABLED */
2527 else {
2528 xmlEncodingErr(XML_I18N_NO_OUTPUT,
2529 "xmlCharEncOutFunc: no output function !\n", NULL);
2530 return(-1);
2531 }
2532
2533 if (ret >= 0) output += ret;
2534
2535 /*
2536 * Attempt to handle error cases
2537 */
2538 switch (ret) {
2539 case 0:
2540 #ifdef DEBUG_ENCODING
2541 xmlGenericError(xmlGenericErrorContext,
2542 "converted %d bytes to %d bytes of output\n",
2543 c_in, c_out);
2544 #endif
2545 break;
2546 case -1:
2547 #ifdef DEBUG_ENCODING
2548 xmlGenericError(xmlGenericErrorContext,
2549 "output conversion failed by lack of space\n");
2550 #endif
2551 break;
2552 case -3:
2553 #ifdef DEBUG_ENCODING
2554 xmlGenericError(xmlGenericErrorContext,"converted %d bytes to %d byt es of output %d left\n",
2555 c_in, c_out, (int) xmlBufUse(in));
2556 #endif
2557 break;
2558 case -2: {
2559 int len = (int) xmlBufUse(in);
2560 xmlChar *content = xmlBufContent(in);
2561 int cur;
2562
2563 cur = xmlGetUTF8Char(content, &len);
2564 if ((charref_len != 0) && (c_out < charref_len)) {
2565 /*
2566 * We attempted to insert a character reference and failed.
2567 * Undo what was written and skip the remaining charref.
2568 */
2569 xmlBufErase(out, c_out);
2570 writtentot -= c_out;
2571 xmlBufShrink(in, charref_len - c_out);
2572 charref_len = 0;
2573
2574 ret = -1;
2575 break;
2576 } else if (cur > 0) {
2577 xmlChar charref[20];
2578
2579 #ifdef DEBUG_ENCODING
2580 xmlGenericError(xmlGenericErrorContext,
2581 "handling output conversion error\n");
2582 xmlGenericError(xmlGenericErrorContext,
2583 "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
2584 content[0], content[1],
2585 content[2], content[3]);
2586 #endif
2587 /*
2588 * Removes the UTF8 sequence, and replace it by a charref
2589 * and continue the transcoding phase, hoping the error
2590 * did not mangle the encoder state.
2591 */
2592 charref_len = snprintf((char *) &charref[0], sizeof(charref),
2593 "&#%d;", cur);
2594 xmlBufShrink(in, len);
2595 xmlBufAddHead(in, charref, -1);
2596
2597 goto retry;
2598 } else {
2599 char buf[50];
2600
2601 snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X",
2602 content[0], content[1],
2603 content[2], content[3]);
2604 buf[49] = 0;
2605 xmlEncodingErr(XML_I18N_CONV_FAILED,
2606 "output conversion failed due to conv error, bytes %s\n",
2607 buf);
2608 if (xmlBufGetAllocationScheme(in) != XML_BUFFER_ALLOC_IMMUTABLE)
2609 content[0] = ' ';
2610 }
2611 break;
2612 }
2613 }
2614 return(ret);
2615 }
2616 #endif
2617
2135 /** 2618 /**
2136 * xmlCharEncOutFunc: 2619 * xmlCharEncOutFunc:
2137 * @handler: char enconding transformation data structure 2620 * @handler: char enconding transformation data structure
2138 * @out: an xmlBuffer for the output. 2621 * @out: an xmlBuffer for the output.
2139 * @in: an xmlBuffer for the input 2622 * @in: an xmlBuffer for the input
2140 * 2623 *
2141 * Generic front-end for the encoding handler output function 2624 * Generic front-end for the encoding handler output function
2142 * a first call with @in == NULL has to be made firs to initiate the 2625 * a first call with @in == NULL has to be made firs to initiate the
2143 * output in case of non-stateless encoding needing to initiate their 2626 * output in case of non-stateless encoding needing to initiate their
2144 * state or the output (like the BOM in UTF16). 2627 * state or the output (like the BOM in UTF16).
2145 * In case of UTF8 sequence conversion errors for the given encoder, 2628 * In case of UTF8 sequence conversion errors for the given encoder,
2146 * the content will be automatically remapped to a CharRef sequence. 2629 * the content will be automatically remapped to a CharRef sequence.
2147 * 2630 *
2148 * Returns the number of byte written if success, or 2631 * Returns the number of byte written if success, or
2149 * -1 general error 2632 * -1 general error
2150 * -2 if the transcoding fails (for *in is not valid utf8 string or 2633 * -2 if the transcoding fails (for *in is not valid utf8 string or
2151 * the result of transformation can't fit into the encoding we want), or 2634 * the result of transformation can't fit into the encoding we want), or
2152 */ 2635 */
2153 int 2636 int
2154 xmlCharEncOutFunc(xmlCharEncodingHandler *handler, xmlBufferPtr out, 2637 xmlCharEncOutFunc(xmlCharEncodingHandler *handler, xmlBufferPtr out,
2155 xmlBufferPtr in) { 2638 xmlBufferPtr in) {
2156 int ret = -2; 2639 int ret = -2;
2157 int written; 2640 int written;
2158 int writtentot = 0; 2641 int writtentot = 0;
2159 int toconv; 2642 int toconv;
2160 int output = 0; 2643 int output = 0;
2644 int charref_len = 0;
2161 2645
2162 if (handler == NULL) return(-1); 2646 if (handler == NULL) return(-1);
2163 if (out == NULL) return(-1); 2647 if (out == NULL) return(-1);
2164 2648
2165 retry: 2649 retry:
2166 2650
2167 written = out->size - out->use; 2651 written = out->size - out->use;
2168 2652
2169 if (written > 0) 2653 if (written > 0)
2170 written--; /* Gennady: count '/0' */ 2654 written--; /* Gennady: count '/0' */
2171 2655
2172 /* 2656 /*
2173 * First specific handling of in = NULL, i.e. the initialization call 2657 * First specific handling of in = NULL, i.e. the initialization call
2174 */ 2658 */
2175 if (in == NULL) { 2659 if (in == NULL) {
2176 toconv = 0; 2660 toconv = 0;
(...skipping 10 matching lines...) Expand all
2187 ret = xmlIconvWrapper(handler->iconv_out, &out->content[out->use], 2671 ret = xmlIconvWrapper(handler->iconv_out, &out->content[out->use],
2188 &written, NULL, &toconv); 2672 &written, NULL, &toconv);
2189 out->use += written; 2673 out->use += written;
2190 out->content[out->use] = 0; 2674 out->content[out->use] = 0;
2191 } 2675 }
2192 #endif /* LIBXML_ICONV_ENABLED */ 2676 #endif /* LIBXML_ICONV_ENABLED */
2193 #ifdef LIBXML_ICU_ENABLED 2677 #ifdef LIBXML_ICU_ENABLED
2194 else if (handler->uconv_out != NULL) { 2678 else if (handler->uconv_out != NULL) {
2195 ret = xmlUconvWrapper(handler->uconv_out, 0, 2679 ret = xmlUconvWrapper(handler->uconv_out, 0,
2196 &out->content[out->use], 2680 &out->content[out->use],
2197 » » » » &written, NULL, &toconv); 2681 » » » » &written, NULL, &toconv);
2198 out->use += written; 2682 out->use += written;
2199 out->content[out->use] = 0; 2683 out->content[out->use] = 0;
2200 } 2684 }
2201 #endif /* LIBXML_ICU_ENABLED */ 2685 #endif /* LIBXML_ICU_ENABLED */
2202 #ifdef DEBUG_ENCODING 2686 #ifdef DEBUG_ENCODING
2203 xmlGenericError(xmlGenericErrorContext, 2687 xmlGenericError(xmlGenericErrorContext,
2204 "initialized encoder\n"); 2688 "initialized encoder\n");
2205 #endif 2689 #endif
2206 return(0); 2690 return(0);
2207 } 2691 }
2208 2692
2209 /* 2693 /*
2210 * Conversion itself. 2694 * Conversion itself.
2211 */ 2695 */
2212 toconv = in->use; 2696 toconv = in->use;
2213 if (toconv == 0) 2697 if (toconv == 0)
2214 return(0); 2698 return(0);
2215 if (toconv * 4 >= written) { 2699 if (toconv * 4 >= written) {
2216 xmlBufferGrow(out, toconv * 4); 2700 xmlBufferGrow(out, toconv * 4);
2217 written = out->size - out->use - 1; 2701 written = out->size - out->use - 1;
2218 } 2702 }
2219 if (handler->output != NULL) { 2703 if (handler->output != NULL) {
2220 ret = handler->output(&out->content[out->use], &written, 2704 ret = handler->output(&out->content[out->use], &written,
2221 in->content, &toconv); 2705 in->content, &toconv);
2222 if (written > 0) { 2706 if (written > 0) {
2223 xmlBufferShrink(in, toconv); 2707 xmlBufferShrink(in, toconv);
2224 out->use += written; 2708 out->use += written;
2225 writtentot += written; 2709 writtentot += written;
2226 » } 2710 » }
2227 out->content[out->use] = 0; 2711 out->content[out->use] = 0;
2228 } 2712 }
2229 #ifdef LIBXML_ICONV_ENABLED 2713 #ifdef LIBXML_ICONV_ENABLED
2230 else if (handler->iconv_out != NULL) { 2714 else if (handler->iconv_out != NULL) {
2231 ret = xmlIconvWrapper(handler->iconv_out, &out->content[out->use], 2715 ret = xmlIconvWrapper(handler->iconv_out, &out->content[out->use],
2232 &written, in->content, &toconv); 2716 &written, in->content, &toconv);
2233 xmlBufferShrink(in, toconv); 2717 xmlBufferShrink(in, toconv);
2234 out->use += written; 2718 out->use += written;
2235 writtentot += written; 2719 writtentot += written;
2236 out->content[out->use] = 0; 2720 out->content[out->use] = 0;
2237 if (ret == -1) { 2721 if (ret == -1) {
2238 if (written > 0) { 2722 if (written > 0) {
2239 /* 2723 /*
2240 * Can be a limitation of iconv 2724 * Can be a limitation of iconv
2241 */ 2725 */
2726 charref_len = 0;
2242 goto retry; 2727 goto retry;
2243 } 2728 }
2244 ret = -3; 2729 ret = -3;
2245 } 2730 }
2246 } 2731 }
2247 #endif /* LIBXML_ICONV_ENABLED */ 2732 #endif /* LIBXML_ICONV_ENABLED */
2248 #ifdef LIBXML_ICU_ENABLED 2733 #ifdef LIBXML_ICU_ENABLED
2249 else if (handler->uconv_out != NULL) { 2734 else if (handler->uconv_out != NULL) {
2250 ret = xmlUconvWrapper(handler->uconv_out, 0, 2735 ret = xmlUconvWrapper(handler->uconv_out, 0,
2251 &out->content[out->use], 2736 &out->content[out->use],
2252 &written, in->content, &toconv); 2737 &written, in->content, &toconv);
2253 xmlBufferShrink(in, toconv); 2738 xmlBufferShrink(in, toconv);
2254 out->use += written; 2739 out->use += written;
2255 writtentot += written; 2740 writtentot += written;
2256 out->content[out->use] = 0; 2741 out->content[out->use] = 0;
2257 if (ret == -1) { 2742 if (ret == -1) {
2258 if (written > 0) { 2743 if (written > 0) {
2259 /* 2744 /*
2260 * Can be a limitation of iconv 2745 * Can be a limitation of iconv
2261 */ 2746 */
2747 charref_len = 0;
2262 goto retry; 2748 goto retry;
2263 } 2749 }
2264 ret = -3; 2750 ret = -3;
2265 } 2751 }
2266 } 2752 }
2267 #endif /* LIBXML_ICU_ENABLED */ 2753 #endif /* LIBXML_ICU_ENABLED */
2268 else { 2754 else {
2269 xmlEncodingErr(XML_I18N_NO_OUTPUT, 2755 xmlEncodingErr(XML_I18N_NO_OUTPUT,
2270 "xmlCharEncOutFunc: no output function !\n", NULL); 2756 "xmlCharEncOutFunc: no output function !\n", NULL);
2271 return(-1); 2757 return(-1);
(...skipping 23 matching lines...) Expand all
2295 xmlGenericError(xmlGenericErrorContext,"converted %d bytes to %d byt es of output %d left\n", 2781 xmlGenericError(xmlGenericErrorContext,"converted %d bytes to %d byt es of output %d left\n",
2296 toconv, written, in->use); 2782 toconv, written, in->use);
2297 #endif 2783 #endif
2298 break; 2784 break;
2299 case -2: { 2785 case -2: {
2300 int len = in->use; 2786 int len = in->use;
2301 const xmlChar *utf = (const xmlChar *) in->content; 2787 const xmlChar *utf = (const xmlChar *) in->content;
2302 int cur; 2788 int cur;
2303 2789
2304 cur = xmlGetUTF8Char(utf, &len); 2790 cur = xmlGetUTF8Char(utf, &len);
2305 » if (cur > 0) { 2791 » if ((charref_len != 0) && (written < charref_len)) {
2792 » » /*
2793 » » * We attempted to insert a character reference and failed.
2794 » » * Undo what was written and skip the remaining charref.
2795 » » */
2796 » » out->use -= written;
2797 » » writtentot -= written;
2798 » » xmlBufferShrink(in, charref_len - written);
2799 » » charref_len = 0;
2800
2801 » » ret = -1;
2802 break;
2803 » } else if (cur > 0) {
2306 xmlChar charref[20]; 2804 xmlChar charref[20];
2307 2805
2308 #ifdef DEBUG_ENCODING 2806 #ifdef DEBUG_ENCODING
2309 xmlGenericError(xmlGenericErrorContext, 2807 xmlGenericError(xmlGenericErrorContext,
2310 "handling output conversion error\n"); 2808 "handling output conversion error\n");
2311 xmlGenericError(xmlGenericErrorContext, 2809 xmlGenericError(xmlGenericErrorContext,
2312 "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n", 2810 "Bytes: 0x%02X 0x%02X 0x%02X 0x%02X\n",
2313 in->content[0], in->content[1], 2811 in->content[0], in->content[1],
2314 in->content[2], in->content[3]); 2812 in->content[2], in->content[3]);
2315 #endif 2813 #endif
2316 /* 2814 /*
2317 * Removes the UTF8 sequence, and replace it by a charref 2815 * Removes the UTF8 sequence, and replace it by a charref
2318 * and continue the transcoding phase, hoping the error 2816 * and continue the transcoding phase, hoping the error
2319 * did not mangle the encoder state. 2817 * did not mangle the encoder state.
2320 */ 2818 */
2321 » » snprintf((char *) &charref[0], sizeof(charref), "&#%d;", cur); 2819 » » charref_len = snprintf((char *) &charref[0], sizeof(charref),
2820 » » » » "&#%d;", cur);
2322 xmlBufferShrink(in, len); 2821 xmlBufferShrink(in, len);
2323 xmlBufferAddHead(in, charref, -1); 2822 xmlBufferAddHead(in, charref, -1);
2324 2823
2325 goto retry; 2824 goto retry;
2326 } else { 2825 } else {
2327 char buf[50]; 2826 char buf[50];
2328 2827
2329 » » snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X", 2828 » » snprintf(&buf[0], 49, "0x%02X 0x%02X 0x%02X 0x%02X",
2330 in->content[0], in->content[1], 2829 in->content[0], in->content[1],
2331 in->content[2], in->content[3]); 2830 in->content[2], in->content[3]);
2332 buf[49] = 0; 2831 buf[49] = 0;
2333 xmlEncodingErr(XML_I18N_CONV_FAILED, 2832 xmlEncodingErr(XML_I18N_CONV_FAILED,
2334 "output conversion failed due to conv error, bytes %s\n", 2833 "output conversion failed due to conv error, bytes %s\n",
2335 buf); 2834 buf);
2336 if (in->alloc != XML_BUFFER_ALLOC_IMMUTABLE) 2835 if (in->alloc != XML_BUFFER_ALLOC_IMMUTABLE)
2337 in->content[0] = ' '; 2836 in->content[0] = ' ';
2338 } 2837 }
2339 break; 2838 break;
2340 } 2839 }
2341 } 2840 }
2342 return(ret); 2841 return(ret);
2343 } 2842 }
2344 2843
2345 /** 2844 /**
2346 * xmlCharEncCloseFunc: 2845 * xmlCharEncCloseFunc:
2347 * @handler: char enconding transformation data structure 2846 * @handler: char enconding transformation data structure
2348 * 2847 *
2349 * Generic front-end for encoding handler close function 2848 * Generic front-end for encoding handler close function
2350 * 2849 *
2351 * Returns 0 if success, or -1 in case of error 2850 * Returns 0 if success, or -1 in case of error
2352 */ 2851 */
2353 int 2852 int
2354 xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) { 2853 xmlCharEncCloseFunc(xmlCharEncodingHandler *handler) {
2355 int ret = 0; 2854 int ret = 0;
2855 int tofree = 0;
2856 int i, handler_in_list = 0;
2857
2356 if (handler == NULL) return(-1); 2858 if (handler == NULL) return(-1);
2357 if (handler->name == NULL) return(-1); 2859 if (handler->name == NULL) return(-1);
2860 if (handlers != NULL) {
2861 for (i = 0;i < nbCharEncodingHandler; i++) {
2862 if (handler == handlers[i]) {
2863 handler_in_list = 1;
2864 break;
2865 }
2866 }
2867 }
2358 #ifdef LIBXML_ICONV_ENABLED 2868 #ifdef LIBXML_ICONV_ENABLED
2359 /* 2869 /*
2360 * Iconv handlers can be used only once, free the whole block. 2870 * Iconv handlers can be used only once, free the whole block.
2361 * and the associated icon resources. 2871 * and the associated icon resources.
2362 */ 2872 */
2363 if ((handler->iconv_out != NULL) || (handler->iconv_in != NULL)) { 2873 if ((handler_in_list == 0) &&
2364 » if (handler->name != NULL) 2874 ((handler->iconv_out != NULL) || (handler->iconv_in != NULL))) {
2365 » xmlFree(handler->name); 2875 tofree = 1;
2366 » handler->name = NULL;
2367 if (handler->iconv_out != NULL) { 2876 if (handler->iconv_out != NULL) {
2368 if (iconv_close(handler->iconv_out)) 2877 if (iconv_close(handler->iconv_out))
2369 ret = -1; 2878 ret = -1;
2370 handler->iconv_out = NULL; 2879 handler->iconv_out = NULL;
2371 } 2880 }
2372 if (handler->iconv_in != NULL) { 2881 if (handler->iconv_in != NULL) {
2373 if (iconv_close(handler->iconv_in)) 2882 if (iconv_close(handler->iconv_in))
2374 ret = -1; 2883 ret = -1;
2375 handler->iconv_in = NULL; 2884 handler->iconv_in = NULL;
2376 } 2885 }
2377 xmlFree(handler);
2378 } 2886 }
2379 #endif /* LIBXML_ICONV_ENABLED */ 2887 #endif /* LIBXML_ICONV_ENABLED */
2380 #ifdef LIBXML_ICU_ENABLED 2888 #ifdef LIBXML_ICU_ENABLED
2381 if ((handler->uconv_out != NULL) || (handler->uconv_in != NULL)) { 2889 if ((handler_in_list == 0) &&
2382 » if (handler->name != NULL) 2890 ((handler->uconv_out != NULL) || (handler->uconv_in != NULL))) {
2383 » xmlFree(handler->name); 2891 tofree = 1;
2384 » handler->name = NULL;
2385 if (handler->uconv_out != NULL) { 2892 if (handler->uconv_out != NULL) {
2386 closeIcuConverter(handler->uconv_out); 2893 closeIcuConverter(handler->uconv_out);
2387 handler->uconv_out = NULL; 2894 handler->uconv_out = NULL;
2388 } 2895 }
2389 if (handler->uconv_in != NULL) { 2896 if (handler->uconv_in != NULL) {
2390 closeIcuConverter(handler->uconv_in); 2897 closeIcuConverter(handler->uconv_in);
2391 handler->uconv_in = NULL; 2898 handler->uconv_in = NULL;
2392 } 2899 }
2393 xmlFree(handler);
2394 } 2900 }
2395 #endif 2901 #endif
2902 if (tofree) {
2903 /* free up only dynamic handlers iconv/uconv */
2904 if (handler->name != NULL)
2905 xmlFree(handler->name);
2906 handler->name = NULL;
2907 xmlFree(handler);
2908 }
2396 #ifdef DEBUG_ENCODING 2909 #ifdef DEBUG_ENCODING
2397 if (ret) 2910 if (ret)
2398 xmlGenericError(xmlGenericErrorContext, 2911 xmlGenericError(xmlGenericErrorContext,
2399 "failed to close the encoding handler\n"); 2912 "failed to close the encoding handler\n");
2400 else 2913 else
2401 xmlGenericError(xmlGenericErrorContext, 2914 xmlGenericError(xmlGenericErrorContext,
2402 "closed the encoding handler\n"); 2915 "closed the encoding handler\n");
2403 #endif 2916 #endif
2404 2917
2405 return(ret); 2918 return(ret);
2406 } 2919 }
2407 2920
2408 /** 2921 /**
2409 * xmlByteConsumed: 2922 * xmlByteConsumed:
2410 * @ctxt: an XML parser context 2923 * @ctxt: an XML parser context
2411 * 2924 *
2412 * This function provides the current index of the parser relative 2925 * This function provides the current index of the parser relative
2413 * to the start of the current entity. This function is computed in 2926 * to the start of the current entity. This function is computed in
2414 * bytes from the beginning starting at zero and finishing at the 2927 * bytes from the beginning starting at zero and finishing at the
2415 * size in byte of the file if parsing a file. The function is 2928 * size in byte of the file if parsing a file. The function is
2416 * of constant cost if the input is UTF-8 but can be costly if run 2929 * of constant cost if the input is UTF-8 but can be costly if run
2417 * on non-UTF-8 input. 2930 * on non-UTF-8 input.
2418 * 2931 *
2419 * Returns the index in bytes from the beginning of the entity or -1 2932 * Returns the index in bytes from the beginning of the entity or -1
2420 * in case the index could not be computed. 2933 * in case the index could not be computed.
2421 */ 2934 */
2422 long 2935 long
2423 xmlByteConsumed(xmlParserCtxtPtr ctxt) { 2936 xmlByteConsumed(xmlParserCtxtPtr ctxt) {
2424 xmlParserInputPtr in; 2937 xmlParserInputPtr in;
2425 2938
2426 if (ctxt == NULL) return(-1); 2939 if (ctxt == NULL) return(-1);
2427 in = ctxt->input; 2940 in = ctxt->input;
2428 if (in == NULL) return(-1); 2941 if (in == NULL) return(-1);
2429 if ((in->buf != NULL) && (in->buf->encoder != NULL)) { 2942 if ((in->buf != NULL) && (in->buf->encoder != NULL)) {
2430 unsigned int unused = 0; 2943 unsigned int unused = 0;
2431 xmlCharEncodingHandler * handler = in->buf->encoder; 2944 xmlCharEncodingHandler * handler = in->buf->encoder;
2432 /* 2945 /*
2433 * Encoding conversion, compute the number of unused original 2946 * Encoding conversion, compute the number of unused original
2434 * bytes from the input not consumed and substract that from 2947 * bytes from the input not consumed and substract that from
2435 * the raw consumed value, this is not a cheap operation 2948 * the raw consumed value, this is not a cheap operation
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
2477 &written, cur, &toconv); 2990 &written, cur, &toconv);
2478 if (ret < 0) { 2991 if (ret < 0) {
2479 if (written > 0) 2992 if (written > 0)
2480 ret = -2; 2993 ret = -2;
2481 else 2994 else
2482 return(-1); 2995 return(-1);
2483 } 2996 }
2484 unused += written; 2997 unused += written;
2485 cur += toconv; 2998 cur += toconv;
2486 } while (ret == -2); 2999 } while (ret == -2);
3000 #endif
2487 } else { 3001 } else {
2488 /* could not find a converter */ 3002 /* could not find a converter */
2489 return(-1); 3003 return(-1);
2490 } 3004 }
2491 } 3005 }
2492 if (in->buf->rawconsumed < unused) 3006 if (in->buf->rawconsumed < unused)
2493 return(-1); 3007 return(-1);
2494 return(in->buf->rawconsumed - unused); 3008 return(in->buf->rawconsumed - unused);
2495 } 3009 }
2496 return(in->consumed + (in->cur - in->base)); 3010 return(in->consumed + (in->cur - in->base));
2497 } 3011 }
2498 #endif
2499 3012
2500 #if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED) 3013 #if !defined(LIBXML_ICONV_ENABLED) && !defined(LIBXML_ICU_ENABLED)
2501 #ifdef LIBXML_ISO8859X_ENABLED 3014 #ifdef LIBXML_ISO8859X_ENABLED
2502 3015
2503 /** 3016 /**
2504 * UTF8ToISO8859x: 3017 * UTF8ToISO8859x:
2505 * @out: a pointer to an array of bytes to store the result 3018 * @out: a pointer to an array of bytes to store the result
2506 * @outlen: the length of @out 3019 * @outlen: the length of @out
2507 * @in: a pointer to an array of UTF-8 chars 3020 * @in: a pointer to an array of UTF-8 chars
2508 * @inlen: the length of @in 3021 * @inlen: the length of @in
2509 * @xlattable: the 2-level transcoding table 3022 * @xlattable: the 2-level transcoding table
2510 * 3023 *
2511 * Take a block of UTF-8 chars in and try to convert it to an ISO 8859-* 3024 * Take a block of UTF-8 chars in and try to convert it to an ISO 8859-*
2512 * block of chars out. 3025 * block of chars out.
2513 * 3026 *
2514 * Returns 0 if success, -2 if the transcoding fails, or -1 otherwise 3027 * Returns 0 if success, -2 if the transcoding fails, or -1 otherwise
2515 * The value of @inlen after return is the number of octets consumed 3028 * The value of @inlen after return is the number of octets consumed
2516 * as the return value is positive, else unpredictable. 3029 * as the return value is positive, else unpredictable.
2517 * The value of @outlen after return is the number of ocetes consumed. 3030 * The value of @outlen after return is the number of ocetes consumed.
2518 */ 3031 */
2519 static int 3032 static int
2520 UTF8ToISO8859x(unsigned char* out, int *outlen, 3033 UTF8ToISO8859x(unsigned char* out, int *outlen,
2521 const unsigned char* in, int *inlen, 3034 const unsigned char* in, int *inlen,
2522 unsigned char const *xlattable) { 3035 unsigned char const *xlattable) {
2523 const unsigned char* outstart = out; 3036 const unsigned char* outstart = out;
2524 const unsigned char* inend; 3037 const unsigned char* inend;
2525 const unsigned char* instart = in; 3038 const unsigned char* instart = in;
3039 const unsigned char* processed = in;
2526 3040
2527 if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || 3041 if ((out == NULL) || (outlen == NULL) || (inlen == NULL) ||
2528 (xlattable == NULL)) 3042 (xlattable == NULL))
2529 return(-1); 3043 return(-1);
2530 if (in == NULL) { 3044 if (in == NULL) {
2531 /* 3045 /*
2532 * initialization nothing to do 3046 * initialization nothing to do
2533 */ 3047 */
2534 *outlen = 0; 3048 *outlen = 0;
2535 *inlen = 0; 3049 *inlen = 0;
2536 return(0); 3050 return(0);
2537 } 3051 }
2538 inend = in + (*inlen); 3052 inend = in + (*inlen);
2539 while (in < inend) { 3053 while (in < inend) {
2540 unsigned char d = *in++; 3054 unsigned char d = *in++;
2541 if (d < 0x80) { 3055 if (d < 0x80) {
2542 *out++ = d; 3056 *out++ = d;
2543 } else if (d < 0xC0) { 3057 } else if (d < 0xC0) {
2544 /* trailing byte in leading position */ 3058 /* trailing byte in leading position */
2545 *outlen = out - outstart; 3059 *outlen = out - outstart;
2546 *inlen = in - instart - 1; 3060 *inlen = processed - instart;
2547 return(-2); 3061 return(-2);
2548 } else if (d < 0xE0) { 3062 } else if (d < 0xE0) {
2549 unsigned char c; 3063 unsigned char c;
2550 if (!(in < inend)) { 3064 if (!(in < inend)) {
2551 /* trailing byte not in input buffer */ 3065 /* trailing byte not in input buffer */
2552 *outlen = out - outstart; 3066 *outlen = out - outstart;
2553 *inlen = in - instart - 1; 3067 *inlen = processed - instart;
2554 return(-2); 3068 return(-3);
2555 } 3069 }
2556 c = *in++; 3070 c = *in++;
2557 if ((c & 0xC0) != 0x80) { 3071 if ((c & 0xC0) != 0x80) {
2558 /* not a trailing byte */ 3072 /* not a trailing byte */
2559 *outlen = out - outstart; 3073 *outlen = out - outstart;
2560 *inlen = in - instart - 2; 3074 *inlen = processed - instart;
2561 return(-2); 3075 return(-2);
2562 } 3076 }
2563 c = c & 0x3F; 3077 c = c & 0x3F;
2564 d = d & 0x1F; 3078 d = d & 0x1F;
2565 d = xlattable [48 + c + xlattable [d] * 64]; 3079 d = xlattable [48 + c + xlattable [d] * 64];
2566 if (d == 0) { 3080 if (d == 0) {
2567 /* not in character set */ 3081 /* not in character set */
2568 *outlen = out - outstart; 3082 *outlen = out - outstart;
2569 *inlen = in - instart - 2; 3083 *inlen = processed - instart;
2570 return(-2); 3084 return(-2);
2571 } 3085 }
2572 *out++ = d; 3086 *out++ = d;
2573 } else if (d < 0xF0) { 3087 } else if (d < 0xF0) {
2574 unsigned char c1; 3088 unsigned char c1;
2575 unsigned char c2; 3089 unsigned char c2;
2576 if (!(in < inend - 1)) { 3090 if (!(in < inend - 1)) {
2577 /* trailing bytes not in input buffer */ 3091 /* trailing bytes not in input buffer */
2578 *outlen = out - outstart; 3092 *outlen = out - outstart;
2579 *inlen = in - instart - 1; 3093 *inlen = processed - instart;
2580 return(-2); 3094 return(-3);
2581 } 3095 }
2582 c1 = *in++; 3096 c1 = *in++;
2583 if ((c1 & 0xC0) != 0x80) { 3097 if ((c1 & 0xC0) != 0x80) {
2584 /* not a trailing byte (c1) */ 3098 /* not a trailing byte (c1) */
2585 *outlen = out - outstart; 3099 *outlen = out - outstart;
2586 *inlen = in - instart - 2; 3100 *inlen = processed - instart;
2587 return(-2); 3101 return(-2);
2588 } 3102 }
2589 c2 = *in++; 3103 c2 = *in++;
2590 if ((c2 & 0xC0) != 0x80) { 3104 if ((c2 & 0xC0) != 0x80) {
2591 /* not a trailing byte (c2) */ 3105 /* not a trailing byte (c2) */
2592 *outlen = out - outstart; 3106 *outlen = out - outstart;
2593 *inlen = in - instart - 2; 3107 *inlen = processed - instart;
2594 return(-2); 3108 return(-2);
2595 } 3109 }
2596 c1 = c1 & 0x3F; 3110 c1 = c1 & 0x3F;
2597 c2 = c2 & 0x3F; 3111 c2 = c2 & 0x3F;
2598 d = d & 0x0F; 3112 d = d & 0x0F;
2599 » d = xlattable [48 + c2 + xlattable [48 + c1 + 3113 » d = xlattable [48 + c2 + xlattable [48 + c1 +
2600 » » » xlattable [32 + d] * 64] * 64]; 3114 » » » xlattable [32 + d] * 64] * 64];
2601 if (d == 0) { 3115 if (d == 0) {
2602 /* not in character set */ 3116 /* not in character set */
2603 *outlen = out - outstart; 3117 *outlen = out - outstart;
2604 *inlen = in - instart - 3; 3118 *inlen = processed - instart;
2605 return(-2); 3119 return(-2);
2606 } 3120 }
2607 *out++ = d; 3121 *out++ = d;
2608 } else { 3122 } else {
2609 /* cannot transcode >= U+010000 */ 3123 /* cannot transcode >= U+010000 */
2610 *outlen = out - outstart; 3124 *outlen = out - outstart;
2611 *inlen = in - instart - 1; 3125 *inlen = processed - instart;
2612 return(-2); 3126 return(-2);
2613 } 3127 }
3128 processed = in;
2614 } 3129 }
2615 *outlen = out - outstart; 3130 *outlen = out - outstart;
2616 *inlen = in - instart; 3131 *inlen = processed - instart;
2617 return(*outlen); 3132 return(*outlen);
2618 } 3133 }
2619 3134
2620 /** 3135 /**
2621 * ISO8859xToUTF8 3136 * ISO8859xToUTF8
2622 * @out: a pointer to an array of bytes to store the result 3137 * @out: a pointer to an array of bytes to store the result
2623 * @outlen: the length of @out 3138 * @outlen: the length of @out
2624 * @in: a pointer to an array of ISO Latin 1 chars 3139 * @in: a pointer to an array of ISO Latin 1 chars
2625 * @inlen: the length of @in 3140 * @inlen: the length of @in
2626 * 3141 *
(...skipping 13 matching lines...) Expand all
2640 const unsigned char* inend; 3155 const unsigned char* inend;
2641 const unsigned char* instop; 3156 const unsigned char* instop;
2642 unsigned int c; 3157 unsigned int c;
2643 3158
2644 if ((out == NULL) || (outlen == NULL) || (inlen == NULL) || 3159 if ((out == NULL) || (outlen == NULL) || (inlen == NULL) ||
2645 (in == NULL) || (unicodetable == NULL)) 3160 (in == NULL) || (unicodetable == NULL))
2646 return(-1); 3161 return(-1);
2647 outend = out + *outlen; 3162 outend = out + *outlen;
2648 inend = in + *inlen; 3163 inend = in + *inlen;
2649 instop = inend; 3164 instop = inend;
2650 c = *in; 3165
2651 while (in < inend && out < outend - 1) { 3166 while ((in < inend) && (out < outend - 2)) {
2652 if (c >= 0x80) { 3167 if (*in >= 0x80) {
2653 c = unicodetable [c - 0x80]; 3168 c = unicodetable [*in - 0x80];
2654 if (c == 0) { 3169 if (c == 0) {
2655 /* undefined code point */ 3170 /* undefined code point */
2656 *outlen = out - outstart; 3171 *outlen = out - outstart;
2657 *inlen = in - instart; 3172 *inlen = in - instart;
2658 return (-1); 3173 return (-1);
2659 } 3174 }
2660 if (c < 0x800) { 3175 if (c < 0x800) {
2661 *out++ = ((c >> 6) & 0x1F) | 0xC0; 3176 *out++ = ((c >> 6) & 0x1F) | 0xC0;
2662 *out++ = (c & 0x3F) | 0x80; 3177 *out++ = (c & 0x3F) | 0x80;
2663 } else { 3178 } else {
2664 *out++ = ((c >> 12) & 0x0F) | 0xE0; 3179 *out++ = ((c >> 12) & 0x0F) | 0xE0;
2665 *out++ = ((c >> 6) & 0x3F) | 0x80; 3180 *out++ = ((c >> 6) & 0x3F) | 0x80;
2666 *out++ = (c & 0x3F) | 0x80; 3181 *out++ = (c & 0x3F) | 0x80;
2667 } 3182 }
2668 ++in; 3183 ++in;
2669 c = *in;
2670 } 3184 }
2671 if (instop - in > outend - out) instop = in + (outend - out); 3185 if (instop - in > outend - out) instop = in + (outend - out);
2672 while (c < 0x80 && in < instop) { 3186 while ((*in < 0x80) && (in < instop)) {
2673 *out++ = c; 3187 *out++ = *in++;
2674 ++in;
2675 c = *in;
2676 } 3188 }
2677 } 3189 }
2678 if (in < inend && out < outend && c < 0x80) { 3190 if ((in < inend) && (out < outend) && (*in < 0x80)) {
2679 *out++ = c; 3191 *out++ = *in++;
2680 ++in; 3192 }
3193 if ((in < inend) && (out < outend) && (*in < 0x80)) {
3194 *out++ = *in++;
2681 } 3195 }
2682 *outlen = out - outstart; 3196 *outlen = out - outstart;
2683 *inlen = in - instart; 3197 *inlen = in - instart;
2684 return (*outlen); 3198 return (*outlen);
2685 } 3199 }
2686 3200
2687 3201
2688 /************************************************************************ 3202 /************************************************************************
2689 * Lookup tables for ISO-8859-2..ISO-8859-16 transcoding * 3203 * Lookup tables for ISO-8859-2..ISO-8859-16 transcoding *
2690 ************************************************************************/ 3204 ************************************************************************/
2691 3205
2692 static unsigned short const xmlunicodetable_ISO8859_2 [128] = { 3206 static unsigned short const xmlunicodetable_ISO8859_2 [128] = {
2693 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 3207 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
2694 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 3208 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
2695 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 3209 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
2696 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 3210 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
2697 0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7, 3211 0x00a0, 0x0104, 0x02d8, 0x0141, 0x00a4, 0x013d, 0x015a, 0x00a7,
2698 0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b, 3212 0x00a8, 0x0160, 0x015e, 0x0164, 0x0179, 0x00ad, 0x017d, 0x017b,
2699 0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7, 3213 0x00b0, 0x0105, 0x02db, 0x0142, 0x00b4, 0x013e, 0x015b, 0x02c7,
2700 0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c, 3214 0x00b8, 0x0161, 0x015f, 0x0165, 0x017a, 0x02dd, 0x017e, 0x017c,
2701 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7, 3215 0x0154, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0139, 0x0106, 0x00c7,
2702 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e, 3216 0x010c, 0x00c9, 0x0118, 0x00cb, 0x011a, 0x00cd, 0x00ce, 0x010e,
2703 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7, 3217 0x0110, 0x0143, 0x0147, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x00d7,
2704 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df, 3218 0x0158, 0x016e, 0x00da, 0x0170, 0x00dc, 0x00dd, 0x0162, 0x00df,
2705 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7, 3219 0x0155, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x013a, 0x0107, 0x00e7,
2706 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f, 3220 0x010d, 0x00e9, 0x0119, 0x00eb, 0x011b, 0x00ed, 0x00ee, 0x010f,
2707 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7, 3221 0x0111, 0x0144, 0x0148, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x00f7,
2708 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9, 3222 0x0159, 0x016f, 0x00fa, 0x0171, 0x00fc, 0x00fd, 0x0163, 0x02d9,
2709 }; 3223 };
2710 3224
2711 static unsigned char const xmltranscodetable_ISO8859_2 [48 + 6 * 64] = { 3225 static unsigned char const xmltranscodetable_ISO8859_2 [48 + 6 * 64] = {
2712 "\x00\x00\x01\x05\x02\x04\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00" 3226 "\x00\x00\x01\x05\x02\x04\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00"
2713 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3227 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2714 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3228 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2715 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3229 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2716 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3230 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2717 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3231 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2718 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3232 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
(...skipping 13 matching lines...) Expand all
2732 "\xd5\xf5\x00\x00\xc0\xe0\x00\x00\xd8\xf8\xa6\xb6\x00\x00\xaa\xba" 3246 "\xd5\xf5\x00\x00\xc0\xe0\x00\x00\xd8\xf8\xa6\xb6\x00\x00\xaa\xba"
2733 "\xa9\xb9\xde\xfe\xab\xbb\x00\x00\x00\x00\x00\x00\x00\x00\xd9\xf9" 3247 "\xa9\xb9\xde\xfe\xab\xbb\x00\x00\x00\x00\x00\x00\x00\x00\xd9\xf9"
2734 "\xdb\xfb\x00\x00\x00\x00\x00\x00\x00\xac\xbc\xaf\xbf\xae\xbe\x00" 3248 "\xdb\xfb\x00\x00\x00\x00\x00\x00\x00\xac\xbc\xaf\xbf\xae\xbe\x00"
2735 "\x00\xc1\xc2\x00\xc4\x00\x00\xc7\x00\xc9\x00\xcb\x00\xcd\xce\x00" 3249 "\x00\xc1\xc2\x00\xc4\x00\x00\xc7\x00\xc9\x00\xcb\x00\xcd\xce\x00"
2736 "\x00\x00\x00\xd3\xd4\x00\xd6\xd7\x00\x00\xda\x00\xdc\xdd\x00\xdf" 3250 "\x00\x00\x00\xd3\xd4\x00\xd6\xd7\x00\x00\xda\x00\xdc\xdd\x00\xdf"
2737 "\x00\xe1\xe2\x00\xe4\x00\x00\xe7\x00\xe9\x00\xeb\x00\xed\xee\x00" 3251 "\x00\xe1\xe2\x00\xe4\x00\x00\xe7\x00\xe9\x00\xeb\x00\xed\xee\x00"
2738 "\x00\x00\x00\xf3\xf4\x00\xf6\xf7\x00\x00\xfa\x00\xfc\xfd\x00\x00" 3252 "\x00\x00\x00\xf3\xf4\x00\xf6\xf7\x00\x00\xfa\x00\xfc\xfd\x00\x00"
2739 }; 3253 };
2740 3254
2741 static unsigned short const xmlunicodetable_ISO8859_3 [128] = { 3255 static unsigned short const xmlunicodetable_ISO8859_3 [128] = {
2742 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 3256 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
2743 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 3257 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
2744 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 3258 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
2745 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 3259 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
2746 0x00a0, 0x0126, 0x02d8, 0x00a3, 0x00a4, 0x0000, 0x0124, 0x00a7, 3260 0x00a0, 0x0126, 0x02d8, 0x00a3, 0x00a4, 0x0000, 0x0124, 0x00a7,
2747 0x00a8, 0x0130, 0x015e, 0x011e, 0x0134, 0x00ad, 0x0000, 0x017b, 3261 0x00a8, 0x0130, 0x015e, 0x011e, 0x0134, 0x00ad, 0x0000, 0x017b,
2748 0x00b0, 0x0127, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x0125, 0x00b7, 3262 0x00b0, 0x0127, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x0125, 0x00b7,
2749 0x00b8, 0x0131, 0x015f, 0x011f, 0x0135, 0x00bd, 0x0000, 0x017c, 3263 0x00b8, 0x0131, 0x015f, 0x011f, 0x0135, 0x00bd, 0x0000, 0x017c,
2750 0x00c0, 0x00c1, 0x00c2, 0x0000, 0x00c4, 0x010a, 0x0108, 0x00c7, 3264 0x00c0, 0x00c1, 0x00c2, 0x0000, 0x00c4, 0x010a, 0x0108, 0x00c7,
2751 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 3265 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
2752 0x0000, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x0120, 0x00d6, 0x00d7, 3266 0x0000, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x0120, 0x00d6, 0x00d7,
2753 0x011c, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x016c, 0x015c, 0x00df, 3267 0x011c, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x016c, 0x015c, 0x00df,
2754 0x00e0, 0x00e1, 0x00e2, 0x0000, 0x00e4, 0x010b, 0x0109, 0x00e7, 3268 0x00e0, 0x00e1, 0x00e2, 0x0000, 0x00e4, 0x010b, 0x0109, 0x00e7,
2755 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 3269 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
2756 0x0000, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x0121, 0x00f6, 0x00f7, 3270 0x0000, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x0121, 0x00f6, 0x00f7,
2757 0x011d, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x016d, 0x015d, 0x02d9, 3271 0x011d, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x016d, 0x015d, 0x02d9,
2758 }; 3272 };
2759 3273
2760 static unsigned char const xmltranscodetable_ISO8859_3 [48 + 7 * 64] = { 3274 static unsigned char const xmltranscodetable_ISO8859_3 [48 + 7 * 64] = {
2761 "\x04\x00\x01\x06\x02\x05\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00" 3275 "\x04\x00\x01\x06\x02\x05\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00"
2762 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3276 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2763 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3277 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2764 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3278 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2765 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3279 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2766 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3280 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2767 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3281 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
(...skipping 17 matching lines...) Expand all
2785 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\xfe\xaa\xba" 3299 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\xfe\xaa\xba"
2786 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdd\xfd\x00\x00" 3300 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xdd\xfd\x00\x00"
2787 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xaf\xbf\x00\x00\x00" 3301 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xaf\xbf\x00\x00\x00"
2788 "\xc0\xc1\xc2\x00\xc4\x00\x00\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf" 3302 "\xc0\xc1\xc2\x00\xc4\x00\x00\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
2789 "\x00\xd1\xd2\xd3\xd4\x00\xd6\xd7\x00\xd9\xda\xdb\xdc\x00\x00\xdf" 3303 "\x00\xd1\xd2\xd3\xd4\x00\xd6\xd7\x00\xd9\xda\xdb\xdc\x00\x00\xdf"
2790 "\xe0\xe1\xe2\x00\xe4\x00\x00\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef" 3304 "\xe0\xe1\xe2\x00\xe4\x00\x00\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
2791 "\x00\xf1\xf2\xf3\xf4\x00\xf6\xf7\x00\xf9\xfa\xfb\xfc\x00\x00\x00" 3305 "\x00\xf1\xf2\xf3\xf4\x00\xf6\xf7\x00\xf9\xfa\xfb\xfc\x00\x00\x00"
2792 }; 3306 };
2793 3307
2794 static unsigned short const xmlunicodetable_ISO8859_4 [128] = { 3308 static unsigned short const xmlunicodetable_ISO8859_4 [128] = {
2795 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 3309 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
2796 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 3310 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
2797 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 3311 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
2798 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 3312 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
2799 0x00a0, 0x0104, 0x0138, 0x0156, 0x00a4, 0x0128, 0x013b, 0x00a7, 3313 0x00a0, 0x0104, 0x0138, 0x0156, 0x00a4, 0x0128, 0x013b, 0x00a7,
2800 0x00a8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00ad, 0x017d, 0x00af, 3314 0x00a8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00ad, 0x017d, 0x00af,
2801 0x00b0, 0x0105, 0x02db, 0x0157, 0x00b4, 0x0129, 0x013c, 0x02c7, 3315 0x00b0, 0x0105, 0x02db, 0x0157, 0x00b4, 0x0129, 0x013c, 0x02c7,
2802 0x00b8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014a, 0x017e, 0x014b, 3316 0x00b8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014a, 0x017e, 0x014b,
2803 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, 3317 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e,
2804 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x012a, 3318 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x012a,
2805 0x0110, 0x0145, 0x014c, 0x0136, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 3319 0x0110, 0x0145, 0x014c, 0x0136, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
2806 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x0168, 0x016a, 0x00df, 3320 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x0168, 0x016a, 0x00df,
2807 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, 3321 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f,
2808 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x012b, 3322 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x012b,
2809 0x0111, 0x0146, 0x014d, 0x0137, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 3323 0x0111, 0x0146, 0x014d, 0x0137, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
2810 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x0169, 0x016b, 0x02d9, 3324 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x0169, 0x016b, 0x02d9,
2811 }; 3325 };
2812 3326
2813 static unsigned char const xmltranscodetable_ISO8859_4 [48 + 6 * 64] = { 3327 static unsigned char const xmltranscodetable_ISO8859_4 [48 + 6 * 64] = {
2814 "\x00\x00\x01\x05\x02\x03\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00" 3328 "\x00\x00\x01\x05\x02\x03\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00"
2815 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3329 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2816 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3330 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2817 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3331 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2818 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3332 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2819 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3333 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2820 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3334 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
(...skipping 13 matching lines...) Expand all
2834 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\xb2\x00\x00\x00\x00" 3348 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\xb2\x00\x00\x00\x00"
2835 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3349 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2836 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3350 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2837 "\x00\xc1\xc2\xc3\xc4\xc5\xc6\x00\x00\xc9\x00\xcb\x00\xcd\xce\x00" 3351 "\x00\xc1\xc2\xc3\xc4\xc5\xc6\x00\x00\xc9\x00\xcb\x00\xcd\xce\x00"
2838 "\x00\x00\x00\x00\xd4\xd5\xd6\xd7\xd8\x00\xda\xdb\xdc\x00\x00\xdf" 3352 "\x00\x00\x00\x00\xd4\xd5\xd6\xd7\xd8\x00\xda\xdb\xdc\x00\x00\xdf"
2839 "\x00\xe1\xe2\xe3\xe4\xe5\xe6\x00\x00\xe9\x00\xeb\x00\xed\xee\x00" 3353 "\x00\xe1\xe2\xe3\xe4\xe5\xe6\x00\x00\xe9\x00\xeb\x00\xed\xee\x00"
2840 "\x00\x00\x00\x00\xf4\xf5\xf6\xf7\xf8\x00\xfa\xfb\xfc\x00\x00\x00" 3354 "\x00\x00\x00\x00\xf4\xf5\xf6\xf7\xf8\x00\xfa\xfb\xfc\x00\x00\x00"
2841 }; 3355 };
2842 3356
2843 static unsigned short const xmlunicodetable_ISO8859_5 [128] = { 3357 static unsigned short const xmlunicodetable_ISO8859_5 [128] = {
2844 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 3358 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
2845 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 3359 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
2846 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 3360 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
2847 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 3361 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
2848 0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407, 3362 0x00a0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407,
2849 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f, 3363 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x00ad, 0x040e, 0x040f,
2850 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417, 3364 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
2851 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f, 3365 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e, 0x041f,
2852 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427, 3366 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
2853 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f, 3367 0x0428, 0x0429, 0x042a, 0x042b, 0x042c, 0x042d, 0x042e, 0x042f,
2854 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, 3368 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
2855 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f, 3369 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e, 0x043f,
2856 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, 3370 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
2857 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f, 3371 0x0448, 0x0449, 0x044a, 0x044b, 0x044c, 0x044d, 0x044e, 0x044f,
2858 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, 3372 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457,
2859 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f, 3373 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x00a7, 0x045e, 0x045f,
2860 }; 3374 };
2861 3375
2862 static unsigned char const xmltranscodetable_ISO8859_5 [48 + 6 * 64] = { 3376 static unsigned char const xmltranscodetable_ISO8859_5 [48 + 6 * 64] = {
2863 "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3377 "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2864 "\x02\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3378 "\x02\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2865 "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3379 "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2866 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3380 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2867 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3381 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2868 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3382 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2869 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3383 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
(...skipping 13 matching lines...) Expand all
2883 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3397 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2884 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3398 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2885 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3399 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2886 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3400 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2887 "\x00\x00\x00\x00\x00\x00\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3401 "\x00\x00\x00\x00\x00\x00\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2888 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3402 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2889 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3403 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2890 }; 3404 };
2891 3405
2892 static unsigned short const xmlunicodetable_ISO8859_6 [128] = { 3406 static unsigned short const xmlunicodetable_ISO8859_6 [128] = {
2893 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 3407 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
2894 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 3408 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
2895 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 3409 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
2896 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 3410 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
2897 0x00a0, 0x0000, 0x0000, 0x0000, 0x00a4, 0x0000, 0x0000, 0x0000, 3411 0x00a0, 0x0000, 0x0000, 0x0000, 0x00a4, 0x0000, 0x0000, 0x0000,
2898 0x0000, 0x0000, 0x0000, 0x0000, 0x060c, 0x00ad, 0x0000, 0x0000, 3412 0x0000, 0x0000, 0x0000, 0x0000, 0x060c, 0x00ad, 0x0000, 0x0000,
2899 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 3413 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
2900 0x0000, 0x0000, 0x0000, 0x061b, 0x0000, 0x0000, 0x0000, 0x061f, 3414 0x0000, 0x0000, 0x0000, 0x061b, 0x0000, 0x0000, 0x0000, 0x061f,
2901 0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627, 3415 0x0000, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
2902 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f, 3416 0x0628, 0x0629, 0x062a, 0x062b, 0x062c, 0x062d, 0x062e, 0x062f,
2903 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637, 3417 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637,
2904 0x0638, 0x0639, 0x063a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 3418 0x0638, 0x0639, 0x063a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
2905 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647, 3419 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647,
2906 0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f, 3420 0x0648, 0x0649, 0x064a, 0x064b, 0x064c, 0x064d, 0x064e, 0x064f,
2907 0x0650, 0x0651, 0x0652, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 3421 0x0650, 0x0651, 0x0652, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
2908 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 3422 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
2909 }; 3423 };
2910 3424
2911 static unsigned char const xmltranscodetable_ISO8859_6 [48 + 5 * 64] = { 3425 static unsigned char const xmltranscodetable_ISO8859_6 [48 + 5 * 64] = {
2912 "\x02\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3426 "\x02\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2913 "\x00\x00\x00\x00\x00\x00\x00\x00\x03\x04\x00\x00\x00\x00\x00\x00" 3427 "\x00\x00\x00\x00\x00\x00\x00\x00\x03\x04\x00\x00\x00\x00\x00\x00"
2914 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3428 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2915 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3429 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2916 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3430 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2917 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3431 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2918 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3432 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2919 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f" 3433 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
2920 "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f" 3434 "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
2921 "\xa0\x00\x00\x00\xa4\x00\x00\x00\x00\x00\x00\x00\x00\xad\x00\x00" 3435 "\xa0\x00\x00\x00\xa4\x00\x00\x00\x00\x00\x00\x00\x00\xad\x00\x00"
2922 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3436 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2923 "\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3437 "\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2924 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3438 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2925 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3439 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2926 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3440 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2927 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xac\x00\x00\x00" 3441 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xac\x00\x00\x00"
2928 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbb\x00\x00\x00\xbf" 3442 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbb\x00\x00\x00\xbf"
2929 "\x00\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf" 3443 "\x00\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
2930 "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\x00\x00\x00\x00\x00" 3444 "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\x00\x00\x00\x00\x00"
2931 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef" 3445 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
2932 "\xf0\xf1\xf2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3446 "\xf0\xf1\xf2\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2933 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3447 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2934 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3448 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2935 }; 3449 };
2936 3450
2937 static unsigned short const xmlunicodetable_ISO8859_7 [128] = { 3451 static unsigned short const xmlunicodetable_ISO8859_7 [128] = {
2938 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 3452 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
2939 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 3453 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
2940 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 3454 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
2941 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 3455 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
2942 0x00a0, 0x2018, 0x2019, 0x00a3, 0x0000, 0x0000, 0x00a6, 0x00a7, 3456 0x00a0, 0x2018, 0x2019, 0x00a3, 0x0000, 0x0000, 0x00a6, 0x00a7,
2943 0x00a8, 0x00a9, 0x0000, 0x00ab, 0x00ac, 0x00ad, 0x0000, 0x2015, 3457 0x00a8, 0x00a9, 0x0000, 0x00ab, 0x00ac, 0x00ad, 0x0000, 0x2015,
2944 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7, 3458 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x0384, 0x0385, 0x0386, 0x00b7,
2945 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f, 3459 0x0388, 0x0389, 0x038a, 0x00bb, 0x038c, 0x00bd, 0x038e, 0x038f,
2946 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397, 3460 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
2947 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f, 3461 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f,
2948 0x03a0, 0x03a1, 0x0000, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7, 3462 0x03a0, 0x03a1, 0x0000, 0x03a3, 0x03a4, 0x03a5, 0x03a6, 0x03a7,
2949 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af, 3463 0x03a8, 0x03a9, 0x03aa, 0x03ab, 0x03ac, 0x03ad, 0x03ae, 0x03af,
2950 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7, 3464 0x03b0, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
2951 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf, 3465 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
2952 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7, 3466 0x03c0, 0x03c1, 0x03c2, 0x03c3, 0x03c4, 0x03c5, 0x03c6, 0x03c7,
2953 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x0000, 3467 0x03c8, 0x03c9, 0x03ca, 0x03cb, 0x03cc, 0x03cd, 0x03ce, 0x0000,
2954 }; 3468 };
2955 3469
2956 static unsigned char const xmltranscodetable_ISO8859_7 [48 + 7 * 64] = { 3470 static unsigned char const xmltranscodetable_ISO8859_7 [48 + 7 * 64] = {
2957 "\x04\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x06" 3471 "\x04\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x05\x06"
2958 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3472 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2959 "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3473 "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2960 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3474 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2961 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3475 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2962 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3476 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2963 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3477 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
(...skipping 17 matching lines...) Expand all
2981 "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf" 3495 "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
2982 "\xd0\xd1\x00\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" 3496 "\xd0\xd1\x00\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
2983 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef" 3497 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
2984 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\x00" 3498 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\x00"
2985 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3499 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2986 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3500 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2987 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3501 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
2988 }; 3502 };
2989 3503
2990 static unsigned short const xmlunicodetable_ISO8859_8 [128] = { 3504 static unsigned short const xmlunicodetable_ISO8859_8 [128] = {
2991 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 3505 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
2992 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 3506 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
2993 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 3507 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
2994 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 3508 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
2995 0x00a0, 0x0000, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 3509 0x00a0, 0x0000, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
2996 0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 3510 0x00a8, 0x00a9, 0x00d7, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
2997 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 3511 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
2998 0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x0000, 3512 0x00b8, 0x00b9, 0x00f7, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x0000,
2999 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 3513 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
3000 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 3514 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
3001 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 3515 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
3002 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2017, 3516 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2017,
3003 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7, 3517 0x05d0, 0x05d1, 0x05d2, 0x05d3, 0x05d4, 0x05d5, 0x05d6, 0x05d7,
3004 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df, 3518 0x05d8, 0x05d9, 0x05da, 0x05db, 0x05dc, 0x05dd, 0x05de, 0x05df,
3005 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7, 3519 0x05e0, 0x05e1, 0x05e2, 0x05e3, 0x05e4, 0x05e5, 0x05e6, 0x05e7,
3006 0x05e8, 0x05e9, 0x05ea, 0x0000, 0x0000, 0x200e, 0x200f, 0x0000, 3520 0x05e8, 0x05e9, 0x05ea, 0x0000, 0x0000, 0x200e, 0x200f, 0x0000,
3007 }; 3521 };
3008 3522
3009 static unsigned char const xmltranscodetable_ISO8859_8 [48 + 7 * 64] = { 3523 static unsigned char const xmltranscodetable_ISO8859_8 [48 + 7 * 64] = {
3010 "\x02\x00\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3524 "\x02\x00\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3011 "\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00" 3525 "\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00"
3012 "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3526 "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3013 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3527 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3014 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3528 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3015 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3529 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3016 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3530 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
(...skipping 17 matching lines...) Expand all
3034 "\x00\x00\x00\x00\x00\x00\x00\xdf\x00\x00\x00\x00\x00\x00\x00\x00" 3548 "\x00\x00\x00\x00\x00\x00\x00\xdf\x00\x00\x00\x00\x00\x00\x00\x00"
3035 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3549 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3036 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3550 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3037 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3551 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3038 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef" 3552 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
3039 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\x00\x00\x00\x00\x00" 3553 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\x00\x00\x00\x00\x00"
3040 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3554 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3041 }; 3555 };
3042 3556
3043 static unsigned short const xmlunicodetable_ISO8859_9 [128] = { 3557 static unsigned short const xmlunicodetable_ISO8859_9 [128] = {
3044 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 3558 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
3045 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 3559 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
3046 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 3560 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
3047 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 3561 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
3048 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7, 3562 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x00a4, 0x00a5, 0x00a6, 0x00a7,
3049 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 3563 0x00a8, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
3050 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7, 3564 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x00b4, 0x00b5, 0x00b6, 0x00b7,
3051 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf, 3565 0x00b8, 0x00b9, 0x00ba, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00bf,
3052 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 3566 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
3053 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 3567 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
3054 0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 3568 0x011e, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
3055 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df, 3569 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0130, 0x015e, 0x00df,
3056 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 3570 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
3057 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 3571 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
3058 0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 3572 0x011f, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
3059 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff, 3573 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0131, 0x015f, 0x00ff,
3060 }; 3574 };
3061 3575
3062 static unsigned char const xmltranscodetable_ISO8859_9 [48 + 5 * 64] = { 3576 static unsigned char const xmltranscodetable_ISO8859_9 [48 + 5 * 64] = {
3063 "\x00\x00\x01\x02\x03\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3577 "\x00\x00\x01\x02\x03\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3064 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3578 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3065 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3579 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3066 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3580 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3067 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3581 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3068 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3582 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3069 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3583 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3070 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f" 3584 "\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f"
3071 "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f" 3585 "\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f"
3072 "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf" 3586 "\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf"
3073 "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf" 3587 "\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf"
3074 "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf" 3588 "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
3075 "\x00\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\x00\x00\xdf" 3589 "\x00\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\x00\x00\xdf"
3076 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef" 3590 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
3077 "\x00\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\x00\x00\xff" 3591 "\x00\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\x00\x00\xff"
3078 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3592 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3079 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\xf0" 3593 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\xf0"
3080 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3594 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3081 "\xdd\xfd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3595 "\xdd\xfd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3082 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3596 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3083 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\xfe" 3597 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xde\xfe"
3084 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3598 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3085 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3599 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3086 }; 3600 };
3087 3601
3088 static unsigned short const xmlunicodetable_ISO8859_10 [128] = { 3602 static unsigned short const xmlunicodetable_ISO8859_10 [128] = {
3089 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 3603 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
3090 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 3604 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
3091 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 3605 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
3092 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 3606 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
3093 0x00a0, 0x0104, 0x0112, 0x0122, 0x012a, 0x0128, 0x0136, 0x00a7, 3607 0x00a0, 0x0104, 0x0112, 0x0122, 0x012a, 0x0128, 0x0136, 0x00a7,
3094 0x013b, 0x0110, 0x0160, 0x0166, 0x017d, 0x00ad, 0x016a, 0x014a, 3608 0x013b, 0x0110, 0x0160, 0x0166, 0x017d, 0x00ad, 0x016a, 0x014a,
3095 0x00b0, 0x0105, 0x0113, 0x0123, 0x012b, 0x0129, 0x0137, 0x00b7, 3609 0x00b0, 0x0105, 0x0113, 0x0123, 0x012b, 0x0129, 0x0137, 0x00b7,
3096 0x013c, 0x0111, 0x0161, 0x0167, 0x017e, 0x2015, 0x016b, 0x014b, 3610 0x013c, 0x0111, 0x0161, 0x0167, 0x017e, 0x2015, 0x016b, 0x014b,
3097 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e, 3611 0x0100, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x012e,
3098 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x00cf, 3612 0x010c, 0x00c9, 0x0118, 0x00cb, 0x0116, 0x00cd, 0x00ce, 0x00cf,
3099 0x00d0, 0x0145, 0x014c, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x0168, 3613 0x00d0, 0x0145, 0x014c, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x0168,
3100 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 3614 0x00d8, 0x0172, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
3101 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f, 3615 0x0101, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x012f,
3102 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x00ef, 3616 0x010d, 0x00e9, 0x0119, 0x00eb, 0x0117, 0x00ed, 0x00ee, 0x00ef,
3103 0x00f0, 0x0146, 0x014d, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x0169, 3617 0x00f0, 0x0146, 0x014d, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x0169,
3104 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x0138, 3618 0x00f8, 0x0173, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x0138,
3105 }; 3619 };
3106 3620
3107 static unsigned char const xmltranscodetable_ISO8859_10 [48 + 7 * 64] = { 3621 static unsigned char const xmltranscodetable_ISO8859_10 [48 + 7 * 64] = {
3108 "\x00\x00\x01\x06\x02\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3622 "\x00\x00\x01\x06\x02\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3109 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3623 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3110 "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3624 "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3111 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3625 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3112 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3626 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3113 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3627 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3114 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3628 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
(...skipping 17 matching lines...) Expand all
3132 "\x00\x00\x00\x00\x00\xbd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3646 "\x00\x00\x00\x00\x00\xbd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3133 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3647 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3134 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3648 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3135 "\x00\xc1\xc2\xc3\xc4\xc5\xc6\x00\x00\xc9\x00\xcb\x00\xcd\xce\xcf" 3649 "\x00\xc1\xc2\xc3\xc4\xc5\xc6\x00\x00\xc9\x00\xcb\x00\xcd\xce\xcf"
3136 "\xd0\x00\x00\xd3\xd4\xd5\xd6\x00\xd8\x00\xda\xdb\xdc\xdd\xde\xdf" 3650 "\xd0\x00\x00\xd3\xd4\xd5\xd6\x00\xd8\x00\xda\xdb\xdc\xdd\xde\xdf"
3137 "\x00\xe1\xe2\xe3\xe4\xe5\xe6\x00\x00\xe9\x00\xeb\x00\xed\xee\xef" 3651 "\x00\xe1\xe2\xe3\xe4\xe5\xe6\x00\x00\xe9\x00\xeb\x00\xed\xee\xef"
3138 "\xf0\x00\x00\xf3\xf4\xf5\xf6\x00\xf8\x00\xfa\xfb\xfc\xfd\xfe\x00" 3652 "\xf0\x00\x00\xf3\xf4\xf5\xf6\x00\xf8\x00\xfa\xfb\xfc\xfd\xfe\x00"
3139 }; 3653 };
3140 3654
3141 static unsigned short const xmlunicodetable_ISO8859_11 [128] = { 3655 static unsigned short const xmlunicodetable_ISO8859_11 [128] = {
3142 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 3656 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
3143 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 3657 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
3144 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 3658 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
3145 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 3659 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
3146 0x00a0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07, 3660 0x00a0, 0x0e01, 0x0e02, 0x0e03, 0x0e04, 0x0e05, 0x0e06, 0x0e07,
3147 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f, 3661 0x0e08, 0x0e09, 0x0e0a, 0x0e0b, 0x0e0c, 0x0e0d, 0x0e0e, 0x0e0f,
3148 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17, 3662 0x0e10, 0x0e11, 0x0e12, 0x0e13, 0x0e14, 0x0e15, 0x0e16, 0x0e17,
3149 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f, 3663 0x0e18, 0x0e19, 0x0e1a, 0x0e1b, 0x0e1c, 0x0e1d, 0x0e1e, 0x0e1f,
3150 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27, 3664 0x0e20, 0x0e21, 0x0e22, 0x0e23, 0x0e24, 0x0e25, 0x0e26, 0x0e27,
3151 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f, 3665 0x0e28, 0x0e29, 0x0e2a, 0x0e2b, 0x0e2c, 0x0e2d, 0x0e2e, 0x0e2f,
3152 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37, 3666 0x0e30, 0x0e31, 0x0e32, 0x0e33, 0x0e34, 0x0e35, 0x0e36, 0x0e37,
3153 0x0e38, 0x0e39, 0x0e3a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0e3f, 3667 0x0e38, 0x0e39, 0x0e3a, 0x0000, 0x0000, 0x0000, 0x0000, 0x0e3f,
3154 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47, 3668 0x0e40, 0x0e41, 0x0e42, 0x0e43, 0x0e44, 0x0e45, 0x0e46, 0x0e47,
3155 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f, 3669 0x0e48, 0x0e49, 0x0e4a, 0x0e4b, 0x0e4c, 0x0e4d, 0x0e4e, 0x0e4f,
3156 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57, 3670 0x0e50, 0x0e51, 0x0e52, 0x0e53, 0x0e54, 0x0e55, 0x0e56, 0x0e57,
3157 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0x0000, 0x0000, 0x0000, 0x0000, 3671 0x0e58, 0x0e59, 0x0e5a, 0x0e5b, 0x0000, 0x0000, 0x0000, 0x0000,
3158 }; 3672 };
3159 3673
3160 static unsigned char const xmltranscodetable_ISO8859_11 [48 + 6 * 64] = { 3674 static unsigned char const xmltranscodetable_ISO8859_11 [48 + 6 * 64] = {
3161 "\x04\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3675 "\x04\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3162 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3676 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3163 "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3677 "\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3164 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3678 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3165 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3679 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3166 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3680 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3167 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3681 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
(...skipping 13 matching lines...) Expand all
3181 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3695 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3182 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3696 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3183 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3697 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3184 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef" 3698 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
3185 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\x00\x00\x00\x00" 3699 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\x00\x00\x00\x00"
3186 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3700 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3187 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3701 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3188 }; 3702 };
3189 3703
3190 static unsigned short const xmlunicodetable_ISO8859_13 [128] = { 3704 static unsigned short const xmlunicodetable_ISO8859_13 [128] = {
3191 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 3705 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
3192 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 3706 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
3193 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 3707 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
3194 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 3708 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
3195 0x00a0, 0x201d, 0x00a2, 0x00a3, 0x00a4, 0x201e, 0x00a6, 0x00a7, 3709 0x00a0, 0x201d, 0x00a2, 0x00a3, 0x00a4, 0x201e, 0x00a6, 0x00a7,
3196 0x00d8, 0x00a9, 0x0156, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00c6, 3710 0x00d8, 0x00a9, 0x0156, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00c6,
3197 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x201c, 0x00b5, 0x00b6, 0x00b7, 3711 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x201c, 0x00b5, 0x00b6, 0x00b7,
3198 0x00f8, 0x00b9, 0x0157, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00e6, 3712 0x00f8, 0x00b9, 0x0157, 0x00bb, 0x00bc, 0x00bd, 0x00be, 0x00e6,
3199 0x0104, 0x012e, 0x0100, 0x0106, 0x00c4, 0x00c5, 0x0118, 0x0112, 3713 0x0104, 0x012e, 0x0100, 0x0106, 0x00c4, 0x00c5, 0x0118, 0x0112,
3200 0x010c, 0x00c9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012a, 0x013b, 3714 0x010c, 0x00c9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012a, 0x013b,
3201 0x0160, 0x0143, 0x0145, 0x00d3, 0x014c, 0x00d5, 0x00d6, 0x00d7, 3715 0x0160, 0x0143, 0x0145, 0x00d3, 0x014c, 0x00d5, 0x00d6, 0x00d7,
3202 0x0172, 0x0141, 0x015a, 0x016a, 0x00dc, 0x017b, 0x017d, 0x00df, 3716 0x0172, 0x0141, 0x015a, 0x016a, 0x00dc, 0x017b, 0x017d, 0x00df,
3203 0x0105, 0x012f, 0x0101, 0x0107, 0x00e4, 0x00e5, 0x0119, 0x0113, 3717 0x0105, 0x012f, 0x0101, 0x0107, 0x00e4, 0x00e5, 0x0119, 0x0113,
3204 0x010d, 0x00e9, 0x017a, 0x0117, 0x0123, 0x0137, 0x012b, 0x013c, 3718 0x010d, 0x00e9, 0x017a, 0x0117, 0x0123, 0x0137, 0x012b, 0x013c,
3205 0x0161, 0x0144, 0x0146, 0x00f3, 0x014d, 0x00f5, 0x00f6, 0x00f7, 3719 0x0161, 0x0144, 0x0146, 0x00f3, 0x014d, 0x00f5, 0x00f6, 0x00f7,
3206 0x0173, 0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x2019, 3720 0x0173, 0x0142, 0x015b, 0x016b, 0x00fc, 0x017c, 0x017e, 0x2019,
3207 }; 3721 };
3208 3722
3209 static unsigned char const xmltranscodetable_ISO8859_13 [48 + 7 * 64] = { 3723 static unsigned char const xmltranscodetable_ISO8859_13 [48 + 7 * 64] = {
3210 "\x00\x00\x01\x04\x06\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3724 "\x00\x00\x01\x04\x06\x05\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3211 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3725 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3212 "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3726 "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3213 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3727 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3214 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3728 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3215 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3729 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3216 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3730 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
(...skipping 17 matching lines...) Expand all
3234 "\x00\x00\x00\x00\x00\x00\xaa\xba\x00\x00\xda\xfa\x00\x00\x00\x00" 3748 "\x00\x00\x00\x00\x00\x00\xaa\xba\x00\x00\xda\xfa\x00\x00\x00\x00"
3235 "\xd0\xf0\x00\x00\x00\x00\x00\x00\x00\x00\xdb\xfb\x00\x00\x00\x00" 3749 "\xd0\xf0\x00\x00\x00\x00\x00\x00\x00\x00\xdb\xfb\x00\x00\x00\x00"
3236 "\x00\x00\xd8\xf8\x00\x00\x00\x00\x00\xca\xea\xdd\xfd\xde\xfe\x00" 3750 "\x00\x00\xd8\xf8\x00\x00\x00\x00\x00\xca\xea\xdd\xfd\xde\xfe\x00"
3237 "\xc2\xe2\x00\x00\xc0\xe0\xc3\xe3\x00\x00\x00\x00\xc8\xe8\x00\x00" 3751 "\xc2\xe2\x00\x00\xc0\xe0\xc3\xe3\x00\x00\x00\x00\xc8\xe8\x00\x00"
3238 "\x00\x00\xc7\xe7\x00\x00\xcb\xeb\xc6\xe6\x00\x00\x00\x00\x00\x00" 3752 "\x00\x00\xc7\xe7\x00\x00\xcb\xeb\xc6\xe6\x00\x00\x00\x00\x00\x00"
3239 "\x00\x00\xcc\xec\x00\x00\x00\x00\x00\x00\xce\xee\x00\x00\xc1\xe1" 3753 "\x00\x00\xcc\xec\x00\x00\x00\x00\x00\x00\xce\xee\x00\x00\xc1\xe1"
3240 "\x00\x00\x00\x00\x00\x00\xcd\xed\x00\x00\x00\xcf\xef\x00\x00\x00" 3754 "\x00\x00\x00\x00\x00\x00\xcd\xed\x00\x00\x00\xcf\xef\x00\x00\x00"
3241 }; 3755 };
3242 3756
3243 static unsigned short const xmlunicodetable_ISO8859_14 [128] = { 3757 static unsigned short const xmlunicodetable_ISO8859_14 [128] = {
3244 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 3758 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
3245 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 3759 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
3246 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 3760 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
3247 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 3761 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
3248 0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7, 3762 0x00a0, 0x1e02, 0x1e03, 0x00a3, 0x010a, 0x010b, 0x1e0a, 0x00a7,
3249 0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178, 3763 0x1e80, 0x00a9, 0x1e82, 0x1e0b, 0x1ef2, 0x00ad, 0x00ae, 0x0178,
3250 0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56, 3764 0x1e1e, 0x1e1f, 0x0120, 0x0121, 0x1e40, 0x1e41, 0x00b6, 0x1e56,
3251 0x1e81, 0x1e57, 0x1e83, 0x1e60, 0x1ef3, 0x1e84, 0x1e85, 0x1e61, 3765 0x1e81, 0x1e57, 0x1e83, 0x1e60, 0x1ef3, 0x1e84, 0x1e85, 0x1e61,
3252 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 3766 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
3253 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 3767 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
3254 0x0174, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x1e6a, 3768 0x0174, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x1e6a,
3255 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x0176, 0x00df, 3769 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x0176, 0x00df,
3256 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 3770 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
3257 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 3771 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
3258 0x0175, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x1e6b, 3772 0x0175, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x1e6b,
3259 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x0177, 0x00ff, 3773 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x0177, 0x00ff,
3260 }; 3774 };
3261 3775
3262 static unsigned char const xmltranscodetable_ISO8859_14 [48 + 10 * 64] = { 3776 static unsigned char const xmltranscodetable_ISO8859_14 [48 + 10 * 64] = {
3263 "\x00\x00\x01\x09\x04\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3777 "\x00\x00\x01\x09\x04\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3264 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3778 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3265 "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3779 "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3266 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3780 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3267 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3781 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3268 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3782 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3269 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3783 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
(...skipping 29 matching lines...) Expand all
3299 "\x00\x00\x00\x00\x00\x00\xb7\xb9\x00\x00\x00\x00\x00\x00\x00\x00" 3813 "\x00\x00\x00\x00\x00\x00\xb7\xb9\x00\x00\x00\x00\x00\x00\x00\x00"
3300 "\xbb\xbf\x00\x00\x00\x00\x00\x00\x00\x00\xd7\xf7\x00\x00\x00\x00" 3814 "\xbb\xbf\x00\x00\x00\x00\x00\x00\x00\x00\xd7\xf7\x00\x00\x00\x00"
3301 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3815 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3302 "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf" 3816 "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
3303 "\x00\xd1\xd2\xd3\xd4\xd5\xd6\x00\xd8\xd9\xda\xdb\xdc\xdd\x00\xdf" 3817 "\x00\xd1\xd2\xd3\xd4\xd5\xd6\x00\xd8\xd9\xda\xdb\xdc\xdd\x00\xdf"
3304 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef" 3818 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
3305 "\x00\xf1\xf2\xf3\xf4\xf5\xf6\x00\xf8\xf9\xfa\xfb\xfc\xfd\x00\xff" 3819 "\x00\xf1\xf2\xf3\xf4\xf5\xf6\x00\xf8\xf9\xfa\xfb\xfc\xfd\x00\xff"
3306 }; 3820 };
3307 3821
3308 static unsigned short const xmlunicodetable_ISO8859_15 [128] = { 3822 static unsigned short const xmlunicodetable_ISO8859_15 [128] = {
3309 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 3823 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
3310 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 3824 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
3311 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 3825 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
3312 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 3826 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
3313 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20ac, 0x00a5, 0x0160, 0x00a7, 3827 0x00a0, 0x00a1, 0x00a2, 0x00a3, 0x20ac, 0x00a5, 0x0160, 0x00a7,
3314 0x0161, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af, 3828 0x0161, 0x00a9, 0x00aa, 0x00ab, 0x00ac, 0x00ad, 0x00ae, 0x00af,
3315 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x017d, 0x00b5, 0x00b6, 0x00b7, 3829 0x00b0, 0x00b1, 0x00b2, 0x00b3, 0x017d, 0x00b5, 0x00b6, 0x00b7,
3316 0x017e, 0x00b9, 0x00ba, 0x00bb, 0x0152, 0x0153, 0x0178, 0x00bf, 3830 0x017e, 0x00b9, 0x00ba, 0x00bb, 0x0152, 0x0153, 0x0178, 0x00bf,
3317 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7, 3831 0x00c0, 0x00c1, 0x00c2, 0x00c3, 0x00c4, 0x00c5, 0x00c6, 0x00c7,
3318 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 3832 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
3319 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7, 3833 0x00d0, 0x00d1, 0x00d2, 0x00d3, 0x00d4, 0x00d5, 0x00d6, 0x00d7,
3320 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df, 3834 0x00d8, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x00dd, 0x00de, 0x00df,
3321 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7, 3835 0x00e0, 0x00e1, 0x00e2, 0x00e3, 0x00e4, 0x00e5, 0x00e6, 0x00e7,
3322 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 3836 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
3323 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7, 3837 0x00f0, 0x00f1, 0x00f2, 0x00f3, 0x00f4, 0x00f5, 0x00f6, 0x00f7,
3324 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff, 3838 0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
3325 }; 3839 };
3326 3840
3327 static unsigned char const xmltranscodetable_ISO8859_15 [48 + 6 * 64] = { 3841 static unsigned char const xmltranscodetable_ISO8859_15 [48 + 6 * 64] = {
3328 "\x00\x00\x01\x05\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3842 "\x00\x00\x01\x05\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3329 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3843 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3330 "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3844 "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3331 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3845 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3332 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3846 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3333 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3847 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3334 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3848 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
(...skipping 13 matching lines...) Expand all
3348 "\x00\x00\xbc\xbd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3862 "\x00\x00\xbc\xbd\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3349 "\xa6\xa8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3863 "\xa6\xa8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3350 "\x00\x00\x00\x00\x00\x00\x00\x00\xbe\x00\x00\x00\x00\xb4\xb8\x00" 3864 "\x00\x00\x00\x00\x00\x00\x00\x00\xbe\x00\x00\x00\x00\xb4\xb8\x00"
3351 "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf" 3865 "\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf"
3352 "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf" 3866 "\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf"
3353 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef" 3867 "\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef"
3354 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff" 3868 "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff"
3355 }; 3869 };
3356 3870
3357 static unsigned short const xmlunicodetable_ISO8859_16 [128] = { 3871 static unsigned short const xmlunicodetable_ISO8859_16 [128] = {
3358 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, 3872 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
3359 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f, 3873 0x0088, 0x0089, 0x008a, 0x008b, 0x008c, 0x008d, 0x008e, 0x008f,
3360 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, 3874 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
3361 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f, 3875 0x0098, 0x0099, 0x009a, 0x009b, 0x009c, 0x009d, 0x009e, 0x009f,
3362 0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x201e, 0x0160, 0x00a7, 3876 0x00a0, 0x0104, 0x0105, 0x0141, 0x20ac, 0x201e, 0x0160, 0x00a7,
3363 0x0161, 0x00a9, 0x0218, 0x00ab, 0x0179, 0x00ad, 0x017a, 0x017b, 3877 0x0161, 0x00a9, 0x0218, 0x00ab, 0x0179, 0x00ad, 0x017a, 0x017b,
3364 0x00b0, 0x00b1, 0x010c, 0x0142, 0x017d, 0x201d, 0x00b6, 0x00b7, 3878 0x00b0, 0x00b1, 0x010c, 0x0142, 0x017d, 0x201d, 0x00b6, 0x00b7,
3365 0x017e, 0x010d, 0x0219, 0x00bb, 0x0152, 0x0153, 0x0178, 0x017c, 3879 0x017e, 0x010d, 0x0219, 0x00bb, 0x0152, 0x0153, 0x0178, 0x017c,
3366 0x00c0, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0106, 0x00c6, 0x00c7, 3880 0x00c0, 0x00c1, 0x00c2, 0x0102, 0x00c4, 0x0106, 0x00c6, 0x00c7,
3367 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf, 3881 0x00c8, 0x00c9, 0x00ca, 0x00cb, 0x00cc, 0x00cd, 0x00ce, 0x00cf,
3368 0x0110, 0x0143, 0x00d2, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x015a, 3882 0x0110, 0x0143, 0x00d2, 0x00d3, 0x00d4, 0x0150, 0x00d6, 0x015a,
3369 0x0170, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0118, 0x021a, 0x00df, 3883 0x0170, 0x00d9, 0x00da, 0x00db, 0x00dc, 0x0118, 0x021a, 0x00df,
3370 0x00e0, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x0107, 0x00e6, 0x00e7, 3884 0x00e0, 0x00e1, 0x00e2, 0x0103, 0x00e4, 0x0107, 0x00e6, 0x00e7,
3371 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef, 3885 0x00e8, 0x00e9, 0x00ea, 0x00eb, 0x00ec, 0x00ed, 0x00ee, 0x00ef,
3372 0x0111, 0x0144, 0x00f2, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x015b, 3886 0x0111, 0x0144, 0x00f2, 0x00f3, 0x00f4, 0x0151, 0x00f6, 0x015b,
3373 0x0171, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0119, 0x021b, 0x00ff, 3887 0x0171, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x0119, 0x021b, 0x00ff,
3374 }; 3888 };
3375 3889
3376 static unsigned char const xmltranscodetable_ISO8859_16 [48 + 9 * 64] = { 3890 static unsigned char const xmltranscodetable_ISO8859_16 [48 + 9 * 64] = {
3377 "\x00\x00\x01\x08\x02\x03\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00" 3891 "\x00\x00\x01\x08\x02\x03\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00"
3378 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3892 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3379 "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3893 "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3380 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3894 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3381 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3895 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3382 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3896 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
3383 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" 3897 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
3562 xmlNewCharEncodingHandler ("ISO-8859-14", ISO8859_14ToUTF8, UTF8ToISO8859_14 ); 4076 xmlNewCharEncodingHandler ("ISO-8859-14", ISO8859_14ToUTF8, UTF8ToISO8859_14 );
3563 xmlNewCharEncodingHandler ("ISO-8859-15", ISO8859_15ToUTF8, UTF8ToISO8859_15 ); 4077 xmlNewCharEncodingHandler ("ISO-8859-15", ISO8859_15ToUTF8, UTF8ToISO8859_15 );
3564 xmlNewCharEncodingHandler ("ISO-8859-16", ISO8859_16ToUTF8, UTF8ToISO8859_16 ); 4078 xmlNewCharEncodingHandler ("ISO-8859-16", ISO8859_16ToUTF8, UTF8ToISO8859_16 );
3565 } 4079 }
3566 4080
3567 #endif 4081 #endif
3568 #endif 4082 #endif
3569 4083
3570 #define bottom_encoding 4084 #define bottom_encoding
3571 #include "elfgcchack.h" 4085 #include "elfgcchack.h"
3572
OLDNEW
« no previous file with comments | « third_party/libxml/src/enc.h ('k') | third_party/libxml/src/entities.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698