Daniel Veillard | 891e404 | 1998-10-19 00:43:02 +0000 | [diff] [blame] | 1 | /* |
| 2 | * encoding.h : interface for the encoding conversion functions needed for |
| 3 | * XML |
| 4 | * |
| 5 | * Related specs: |
| 6 | * rfc2044 (UTF-8 and UTF-16) F. Yergeau Alis Technologies |
| 7 | * [ISO-10646] UTF-8 and UTF-16 in Annexes |
| 8 | * [ISO-8859-1] ISO Latin-1 characters codes. |
| 9 | * [UNICODE] The Unicode Consortium, "The Unicode Standard -- |
| 10 | * Worldwide Character Encoding -- Version 1.0", Addison- |
| 11 | * Wesley, Volume 1, 1991, Volume 2, 1992. UTF-8 is |
| 12 | * described in Unicode Technical Report #4. |
| 13 | * [US-ASCII] Coded Character Set--7-bit American Standard Code for |
| 14 | * Information Interchange, ANSI X3.4-1986. |
| 15 | * |
Daniel Veillard | 891e404 | 1998-10-19 00:43:02 +0000 | [diff] [blame] | 16 | * See Copyright for the status of this software. |
| 17 | * |
Daniel Veillard | 891e404 | 1998-10-19 00:43:02 +0000 | [diff] [blame] | 18 | * Daniel.Veillard@w3.org |
| 19 | */ |
| 20 | |
Daniel Veillard | 27d8874 | 1999-05-29 11:51:49 +0000 | [diff] [blame] | 21 | #ifndef __XML_CHAR_ENCODING_H__ |
| 22 | #define __XML_CHAR_ENCODING_H__ |
Daniel Veillard | 891e404 | 1998-10-19 00:43:02 +0000 | [diff] [blame] | 23 | |
| 24 | #ifdef __cplusplus |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
Daniel Veillard | 27d8874 | 1999-05-29 11:51:49 +0000 | [diff] [blame] | 28 | typedef enum { |
| 29 | XML_CHAR_ENCODING_ERROR= -1, /* No char encoding detected */ |
| 30 | XML_CHAR_ENCODING_NONE= 0, /* No char encoding detected */ |
| 31 | XML_CHAR_ENCODING_UTF8= 1, /* UTF-8 */ |
| 32 | XML_CHAR_ENCODING_UTF16LE= 2, /* UTF-16 little endian */ |
| 33 | XML_CHAR_ENCODING_UTF16BE= 3, /* UTF-16 big endian */ |
| 34 | XML_CHAR_ENCODING_UCS4LE= 4, /* UCS-4 little endian */ |
| 35 | XML_CHAR_ENCODING_UCS4BE= 5, /* UCS-4 big endian */ |
| 36 | XML_CHAR_ENCODING_EBCDIC= 6, /* EBCDIC uh! */ |
| 37 | XML_CHAR_ENCODING_UCS4_2143=7, /* UCS-4 unusual ordering */ |
| 38 | XML_CHAR_ENCODING_UCS4_3412=8, /* UCS-4 unusual ordering */ |
| 39 | XML_CHAR_ENCODING_UCS2= 9, /* UCS-2 */ |
| 40 | XML_CHAR_ENCODING_8859_1= 10,/* ISO-8859-1 ISO Latin 1 */ |
| 41 | XML_CHAR_ENCODING_8859_2= 11,/* ISO-8859-2 ISO Latin 2 */ |
| 42 | XML_CHAR_ENCODING_8859_3= 12,/* ISO-8859-3 */ |
| 43 | XML_CHAR_ENCODING_8859_4= 13,/* ISO-8859-4 */ |
| 44 | XML_CHAR_ENCODING_8859_5= 14,/* ISO-8859-5 */ |
| 45 | XML_CHAR_ENCODING_8859_6= 15,/* ISO-8859-6 */ |
| 46 | XML_CHAR_ENCODING_8859_7= 16,/* ISO-8859-7 */ |
| 47 | XML_CHAR_ENCODING_8859_8= 17,/* ISO-8859-8 */ |
| 48 | XML_CHAR_ENCODING_8859_9= 18,/* ISO-8859-9 */ |
| 49 | XML_CHAR_ENCODING_2022_JP= 19,/* ISO-2022-JP */ |
| 50 | XML_CHAR_ENCODING_SHIFT_JIS=20,/* Shift_JIS */ |
| 51 | XML_CHAR_ENCODING_EUC_JP= 21,/* EUC-JP */ |
| 52 | } xmlCharEncoding; |
| 53 | |
Daniel Veillard | 011b63c | 1999-06-02 17:44:04 +0000 | [diff] [blame] | 54 | extern xmlCharEncoding xmlDetectCharEncoding(const unsigned char* in); |
| 55 | extern xmlCharEncoding xmlParseCharEncoding(const char* name); |
Daniel Veillard | 27d8874 | 1999-05-29 11:51:49 +0000 | [diff] [blame] | 56 | |
Daniel Veillard | 891e404 | 1998-10-19 00:43:02 +0000 | [diff] [blame] | 57 | #ifdef __cplusplus |
| 58 | } |
| 59 | #endif |
| 60 | |
Daniel Veillard | 27d8874 | 1999-05-29 11:51:49 +0000 | [diff] [blame] | 61 | #endif /* __XML_CHAR_ENCODING_H__ */ |