3 Encode::Supported -- Supported encodings by Encode
9 Encoding names are case insensitive. White space in names
10 is ignored. In addition an encoding may have aliases.
11 Each encoding has one "canonical" name. The "canonical"
12 name is chosen from the names of the encoding by picking
13 the first in the following sequence (with a few exceptions).
19 The name used by the Perl community. That includes 'utf8' and 'ascii'.
20 Unlike aliases, canonical names directly reach the method so such
21 frequently used words like 'utf8' don't need to do alias lookups.
25 The MIME name as defined in IETF RFCs This includes all "iso-"'s.
29 The name in the IANA registry.
33 The name used by the organization that defined it.
37 In case I<de jure> canonical names differ from that of the Encode
38 module, they are always aliased if it ever be implemented. So you can
39 safely tell if a given encoding is implemented or not just by passing
42 Because of all the alias issues, and because in the general case
43 encodings have state, "Encode" uses an encoding object internally
44 once an operation is in progress.
46 =head1 Supported Encodings
48 As of Perl 5.8.0, at least the following encodings are recognized.
49 Note that unless otherwise specified, they are all case insensitive
50 (via alias) and all occurrence of spaces are replaced with '-'.
51 In other words, "ISO 8859 1" and "iso-8859-1" are identical.
53 Encodings are categorized and implemented in several different modules
54 but you don't have to C<use Encode::XX> to make them available for
55 most cases. Encode.pm will automatically load those modules on demand.
57 =head2 Built-in Encodings
59 The following encodings are always available.
61 Canonical Aliases Comments & References
62 ----------------------------------------------------------------
64 iso-8859-1 latin1 [ISO]
66 ----------------------------------------------------------------
68 =head2 Encode::Unicode -- other Unicode encodings
70 Unicode coding schemes other than native utf8 are supported by
71 Encode::Unicode which will be autoloaded on demand.
73 ----------------------------------------------------------------
74 UCS-2BE UCS-2, iso-10646-1 [IANA, UC]
82 ----------------------------------------------------------------
84 To find how those (UCS-2|UTF-(16|32))(LE|BE)? differ to one another,
85 see L<Encode::Unicode>.
87 =head2 Encode::Byte -- Extended ASCII
89 Encode::Byte implements most of single-byte encodings except for
90 Symbols and EBCDIC. The following encodings are based single-byte
91 encoding implemented as extended ASCII. For most cases it uses
92 \x80-\xff (upper half) to map non-ASCII characters.
96 =item ISO-8859 and corresponding vendor mappings
98 Since there are so many, they are presented in table format with
99 languages and corresponding encoding names by vendors. Note the table
100 is sorted in order of ISO-8859 and the corresponding vendor mappings
101 are slightly different from that of ISO. See
102 L<http://czyborra.com/charsets/iso8859.html> for details.
104 Lang/Regions ISO/Other Std. DOS Windows Macintosh Others
105 ----------------------------------------------------------------
106 N. America (ASCII) cp437 AdobeStandardEncoding
108 W. Europe iso-8859-1 cp850 cp1252 MacRoman nextstep
110 cp860 (DOSPortuguese)
111 Cntrl. Europe iso-8859-2 cp852 cp1250 MacCentralEurRoman
115 Latin3 [1] iso-8859-3
116 Latin4 [2] iso-8859-4
117 Cyrillics iso-8859-5 cp855 cp1251 MacCyrillic
118 (Also see next section) cp866 MacUkrainian
119 Arabic iso-8859-6 cp864 cp1256 MacArabic
121 Greek iso-8859-7 cp737 cp1253 MacGreek
123 Hebrew iso-8859-8 cp862 cp1255 MacHebrew
124 Turkish iso-8859-9 cp857 cp1254 MacTurkish
125 Nordics iso-8859-10 cp865
128 Thai iso-8859-11 [3] cp874 MacThai
129 (iso-8859-12 is nonexistent. Reserved for Indics?)
130 Baltics iso-8859-13 cp775 cp1257
132 Latin9 [4] iso-8859-15
134 Vietnamese viscii cp1258 MacVietnamese
135 ----------------------------------------------------------------
137 [1] Esperanto, Maltese, and Turkish. Turkish is now on 8859-5.
138 [2] Baltics. Now on 8859-10.
139 [3] Also know as TIS 620.
140 [4] Nicknamed Latin0; Euro sign as well as French and Finnish
141 letters that are missing from 8859-1 are added.
143 All cp* are also available as ibm-*, ms-*, and windows-* . See also
144 L<http://czyborra.com/charsets/codepages.html>.
146 Macintosh encodings don't seem to be registered in such entities as
147 IANA. "Canonical" names in Encode are based upon Apple's Tech Note
148 1150. See L<http://developer.apple.com/technotes/tn/tn1150.html>
151 =item KOI8 - De Facto Standard for Cyrillic world
153 Though ISO-8859 does have ISO-8859, KOI8 series is far more popular
154 in the Net. L<Encode> comes with the following KOI charsets.
155 For gory details, see L<http://czyborra.com/charsets/cyrillic.html>
157 ----------------------------------------------------------------
159 koi8-r cp878 [RFC1489]
161 ----------------------------------------------------------------
163 =item gsm0338 - Hentai Latin 1
165 GSM0338 is for GSM handsets. Though it shares alphanumerals with
166 ASCII, control character ranges and other parts are mapped very
167 differently, presumably to store Greek and Cyrillic alphabets.
168 This is also covered in Encode::Byte even though it does not
169 comply to extended ASCII.
173 =head2 The CJK: Chinese, Japanese, Korean (Multibyte)
175 Note that Vietnamese is listed above. Also read "Encoding vs Charset"
176 below. Also note these are implemented in distinct module by
177 languages, due the the size concerns. Please refer to their
178 respective document pages.
182 =item Encode::CN -- Continental China
184 Standard DOS/Win Macintosh Comment/Reference
185 ----------------------------------------------------------------
186 euc-cn [1] MacChineseSimp
188 gb12345-raw { GB12345 without CES }
189 gb2312-raw { GB2312 without CES }
192 ----------------------------------------------------------------
194 [1] GB2312 is aliased to this. see L<Microsoft-related naming mess>
195 [2] gbk is aliased to this. see L<Microsoft-related naming mess>
197 =item Encode::JP -- Japan
199 Standard DOS/Win Macintosh Comment/Reference
200 ----------------------------------------------------------------
202 shiftjis cp932 macJapanese
205 iso-2022-jp [RFC1468]
206 iso-2022-jp-1 [RFC2237]
207 jis0201-raw { JIS X 0201 (roman + halfwidth kana) without CES }
208 jis0208-raw { JIS X 0208 (Kanji + fullwidth kana) without CES }
209 jis0212-raw { JIS X 0212 (Extended Kanji) without CES }
210 ----------------------------------------------------------------
212 =item Encode::KR -- Korea
214 Standard DOS/Win Macintosh Comment/Reference
215 ----------------------------------------------------------------
216 euc-kr MacKorean [RFC1557]
218 iso-2022-kr [RFC1557]
219 johab [KS X 1001:1998, Annex 3]
220 ksc5601-raw { KSC5601 without CES }
221 ----------------------------------------------------------------
223 [1] ks_c_5601-1987, (x-)?windows-949, and uhc are aliased to this.
226 =item Encode::TW -- Taiwan
228 Standard DOS/Win Macintosh Comment/Reference
229 ----------------------------------------------------------------
230 big5-eten cp950 MacChineseTrad {big5 aliased to big5-eten}
232 ----------------------------------------------------------------
234 =item Encode::HanExtra -- More Chinese via CPAN
236 Due to size concerns, additional Chinese encodings below are
237 distributed separately on CPAN, under the name Encode::HanExtra.
239 Standard DOS/Win Macintosh Comment/Reference
240 ----------------------------------------------------------------
244 ----------------------------------------------------------------
248 =head2 Miscellaneous encodings
254 See L<perlebcdic> for details.
256 ----------------------------------------------------------------
263 ----------------------------------------------------------------
265 =item Encode::Symbols
267 For symbols and dingbats.
269 ----------------------------------------------------------------
275 ----------------------------------------------------------------
279 =head1 Unsupported encodings
281 The following are not supported as yet. Some because they are rarely
282 used, some because of technical difficulties. They may be supported by
283 external modules via CPAN in future, however.
287 =item ISO-2022-JP-2 [RFC1554]
289 Not very popular yet. Needs Unicode Database or equivalent to
290 implement encode() (Because it includes JIS X 0208/0212, KSC5601, and
291 GB2312 simultaneously, which code points in Unicode overlap. So you
292 need to lookup the database to determine what character set a given
293 Unicode character should belong).
295 =item ISO-2022-CN [RFC1922]
297 Not very popular. Needs CNS 11643-1 and 2 which are not available in
298 this module. CNS 11643 is supported (via euc-tw) in Encode::HanExtra.
299 Autrijus may add support for this encoding in his module in future.
301 =item various UP-UX encodings
303 The following are unsupported due to the lack of mapping data.
305 '8' - arabic8, greek8, hebrew8, kana8, thai8, and turkish8
306 '15' - japanese15, korean15, and roi15
308 =item Cyrillic encoding ISO-IR-111
310 Anton doubts its usefulness.
312 =item ISO-8859-8-1 [Hebrew]
314 None of the Encode team knows Hebrew enough (ISO-8859-8, cp1255 and
315 MacHebrew are supported because and just because there were mappings
316 available at L<http://www.unicode.org/>). Contributions welcome.
318 =item ISIRI 3342, Iran System, ISIRI 2900 [Farsi]
322 =item Thai encoding TCVN
326 =item Vietnamese encodings VPS
328 Though Jungshik has reported that Mozilla supports this encoding it
329 was too late before 5.8.0 for us to add one. In future via a separate
331 L<http://lxr.mozilla.org/seamonkey/source/intl/uconv/ucvlatin/vps.uf>
333 L<http://lxr.mozilla.org/seamonkey/source/intl/uconv/ucvlatin/vps.ut>
334 if you are interested in helping us.
336 =item Various Mac encodings
338 The following are unsupported due to the lack of mapping data.
340 MacArmenian, MacBengali, MacBurmese, MacEthiopic
341 MacExtArabic, MacGeorgian, MacKannada, MacKhmer
342 MacLaotian, MacMalayalam, MacMongolian, MacOriya
343 MacSinhalese, MacTamil, MacTelugu, MacTibetan
346 The rest of which already available are based upon the vendor mappings
347 at L<http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/> .
349 =item (Mac) Indic encodings
351 The maps for the following is available at L<http://www.unicode.org/>
352 but remains unsupport because those encodings need algorithmical
353 approach, currently unsupported by F<enc2xs>
359 For details, please see C<Unicode mapping issues and notes:> at
360 L<http://www.unicode.org/Public/MAPPINGS/VENDORS/APPLE/DEVANAGA.TXT> .
362 I believe this issue is prevalent not only for Mac Indics but also in
363 other Indic encodings, but the above were the only Indic encodings
364 maps that I could find at L<http://www.unicode.org/> .
368 =head1 Encoding vs. Charset -- terminology
370 We are used to using the term (character) I<encoding> and I<character set>
371 interchangeably. But just as using the term byte and character is
372 dangerous and should be differentiated when needed, we need to
373 differentiate I<encoding> and I<character set>.
375 To understand that, it's follow how we make computers grok our characters.
381 First we start with which characters to include. We call this
382 collection of characters I<character repertoire>.
386 Then we have to give each character a unique ID so your computer can
387 tell the difference from 'a' to 'A'. This itemized character
388 repertoire is now a I<character set>.
392 If your computer can grow the character set without further
393 processing, you can go ahead use it. This is called a I<coded
394 character set> (CCS) or I<raw character encoding>. ASCII is used this
399 But in many cases especially multi-byte CJK encodings, you have to
400 tweak a little more. Your network connection may not accept any data
401 with the Most Significant Bit set, Your computer may not be able to
402 tell if a given byte is a whole character or just half of it. So you
403 have to I<encode> the character set to use it.
405 A I<character encoding scheme> (CES) determines how to encode a given
406 character set, or a set of multiple character sets. 7bit ISO-2022 is
407 an example of CES. You switch between character sets via I<escape
412 Technically, or Mathematically speaking, a character set encoded in
413 such a CES that maps character by character may form a CCS. EUC is such
414 an example. CES of EUC is as follows;
424 Map such a character set that consists of 94 or 96 powered by N
425 members by adding 0x80 to each byte.
429 You can also use 0x8e and 0x8f to tell the following sequence of
430 characters belong to yet another character set. each following byte
435 By carefully looking at at the encoded byte sequence, you may find the
436 byte sequence conforms a unique number. In that sense EUC is a CCS
437 generated by a CES above from up to four CCS (complicated?). UTF-8
438 falls into this category. See L<perlUnicode/"UTF-8"> to find how
439 UTF-8 maps Unicode to a byte sequence.
441 You may also find by now why 7bit ISO-2022 cannot conform a CCS. If
442 you look at a byte sequence \x21\x21, you can't tell if it is two !'s
443 or IDEOGRAPHIC SPACE. EUC maps the latter to \xA1\xA1 so you have no
444 trouble between "!!". and " "
446 =head1 Encoding Classification (by Anton Tagunov and Dan Kogai)
448 This section tries to classify the supported encodings by their
449 applicability for information exchange over the Internet and to
450 choose the most suitable aliases to name them in the context of
457 To (en|de) code Encodings marked as C<(**)>, You need
458 C<Encode::HanExtra>, available from CPAN.
464 US-ASCII UTF-8 ISO-8859-* KOI8-R
465 Shift_JIS EUC-JP ISO-2022-JP ISO-2022-JP-1
468 are registered to IANA as preferred MIME names and may probably
469 be used over the Internet.
471 C<Shift_JIS> has been officialized by JIS X 0208:1997.
472 L<Microsoft-related naming mess> gives details.
474 C<GB2312> is the IANA name for C<EUC-CN>.
475 See L<Microsoft-related naming mess> for details.
477 C<GB_2312-80> I<raw> encoding is available as C<gb2312-raw>
478 with Encode. See L<Encode::CN> for details.
483 have not been registered with IANA (as of March 2002) but
484 seem to be supported by major web browsers.
485 IANA name for C<EUC-CN> is C<GB2312>.
490 See L<Microsoft-related naming mess> for details.
492 C<KS_C_5601-1987> I<raw> encoding is available as C<kcs5601-raw>
493 with Encode. See L<Encode::KR> for details.
495 UTF-16 UTF-16BE UTF-16LE
497 are IANA-registered C<charset>s. See [RFC 2781] for details.
498 Jungshik Shin reports that UTF-16 with a BOM is well accepted
499 by MS IE 5/6 and NS 4/6. Beware however that
505 C<UTF-16> support in any software you're going to be
506 using/interoperating with has probably been less tested
507 then C<UTF-8> support
511 C<UTF-8> coded data seamlessly passes traditional
512 command piping (C<cat>, C<more>, etc.) while C<UTF-16> coded
513 data is likely to cause confusion (with it's zero bytes,
518 it is beyond the power of words to describe the way HTML browsers
519 encode non-C<ASCII> form data. To get a general impression visit
520 L<http://ppewww.ph.gla.ac.uk/~flavell/charset/form-i18n.html>.
521 While encoding of form data has stabilized for C<UTF-8> coded pages
522 (at least IE 5/6, NS 6, Opera 6 behave consistently), be sure to
523 expect fun (and cross-browser discrepancies) with C<UTF-16> coded
528 The rule of thumb is to use C<UTF-8> unless you know what
529 you're doing and unless you really benefit from using C<UTF-16>.
535 GB 18030 (**) (see links bellow)
538 are totally valid encodings but not registered at IANA.
539 The names under which they are listed here are probably the
540 most widely-known names for these encodings and are recommended
545 is a bit proprietary name.
547 =head2 Microsoft-related naming mess
549 Microsoft products misuse the following names:
555 Microsoft extension to C<EUC-KR>.
557 Proper names: C<CP949>, C<UHC>, C<x-windows-949> (as used by Mozilla).
559 See L<http://lists.w3.org/Archives/Public/ietf-charsets/2001AprJun/0033.html>
562 Encode aliases C<KS_C_5601-1987> to C<cp949> to reflect this common
563 misusage. I<Raw> C<KS_C_5601-1987> encoding is available as
566 See L<Encode::KR> for details.
570 Microsoft extension to C<EUC-CN>.
572 Proper names: C<CP936>, C<GBK>.
574 C<GB2312> has been registered in the C<EUC-CN> meaning at
575 IANA. This has partially repaired the situation: Microsoft's
576 C<GB2312> has become a superset of the official C<GB2312>.
578 Encode aliases C<GB2312> to C<euc-cn> in full agreement with
579 IANA registration. C<cp936> is supported separately.
580 I<Raw> C<GB_2312-80> encoding is available as C<gb2312-raw>.
582 See L<Encode::CN> for details.
586 Microsoft extension to C<Big5>.
588 Proper name: C<CP950>.
590 Encode separately supports C<Big5> and C<cp950>.
594 Microsoft's understanding of C<Shift_JIS>.
596 JIS has not endorsed the full Microsoft standard however.
597 The official C<Shift_JIS> includes only JIS X 0201 and JIS X 0208
598 character sets, while Microsoft has always been meaning C<Shift_JIS>
599 to encode a wider character repertoire. See C<IANA> registration for
602 As a historical predecessor Microsoft's variant
603 probably has more rights for the name, albeit it may be objected
604 that Microsoft shouldn't have used JIS as part of the name
607 Unambiguous name: C<CP932>. C<IANA> name (not used?): C<Windows-31J>.
609 Encode separately supports C<Shift_JIS> and C<cp932>.
617 =item character repertoire
619 A collection of unique characters. A I<character> set in the most
620 strict sense. At this stage characters are not numbered.
622 =item coded character set (CCS)
624 A character set that is mapped in a way computers can use directly.
625 Many character encodings including EUC falls in this category.
627 =item character encoding scheme (CES)
629 An algorithm to map a character set to a byte sequence. You don't
630 have to be able to tell which character set a given byte sequence
631 belongs. 7-bit ISO-2022 is a CES but it cannot be a CCS. EUC is an
632 example of being both a CCS and CES.
634 =item charset (in MIME context)
636 has long been used in the meaning of C<encoding>, CES.
638 While C<character set> word combination has lost this meaning
639 in MIME context since [RFC 2130], C<charset> abbreviation has
640 retained it. This is how [RFC 2277], [RFC 2278] bless C<charset>:
643 This document uses the term "charset" to mean a set of rules for
644 mapping from a sequence of octets to a sequence of characters, such
645 as the combination of a coded character set and a character encoding
646 scheme; this is also what is used as an identifier in MIME "charset="
647 parameters, and registered in the IANA charset registry ... (Note
648 that this is NOT a term used by other standards bodies, such as ISO).
653 Extended Unix Character. See ISO-2022
657 A CES that was carefully designed to coexist with ASCII. There are 7
658 bit version and 8 bit version.
660 7 bit version switches character set via escape sequence so this
661 cannot form a CCS. Since this is more difficult to handle in programs
662 than the 8 bit version, 7 bit version is not very popular except for
663 iso-2022-jp, the de facto standard CES for e-mails.
665 8 bit version can conform a CCS. EUC and ISO-8859 are two examples
666 thereof. Pre-5.6 perl could use them as string literals.
670 Short for I<Universal Character Set>. When you say just UCS, it means
675 ISO/IEC 10646 encoding form: Universal Character Set coded in two
680 A Character Set that aims to include all character repertoire of the
681 world. Many character sets in various national as well as industrial
682 standards have become, in a way, just subsets of Unicode.
686 Short for I<Unicode Transformation Format>. Determines how to map a
687 Unicode character into byte sequence.
691 A UTF in 16-bit encoding. Can either be in big endian or little
692 endian. Big endian version is called UTF-16BE (equals to UCS-2 +
693 Surrogate Support) and little endian version is UTF-16LE.
701 L<Encode::CN>, L<Encode::JP>, L<Encode::KR>, L<Encode::TW>,
702 L<Encode::EBCDIC>, L<Encode::Symbol>
710 European Computer Manufacturers Association
711 L<http://www.ecma.ch>
715 =item EMCA-035 (eq C<ISO-2022>)
717 L<http://www.ecma.ch/ecma1/STAND/ECMA-035.HTM>
719 The very specification of ISO-2022 is available from the link above.
725 Internet Assigned Numbers Authority
726 L<http://www.iana.org/>
730 =item Assigned Charset Names by IANA
732 L<http://www.iana.org/assignments/character-sets>
734 Most of the C<canonical names> in Encode derive from this list
735 so you can directly apply the string you have extracted from MIME
736 header of mails and web pages.
742 International Organization for Standardization
743 L<http://www.iso.ch/>
747 Request For Comments -- need I say more?
748 L<http://www.rfc.net/>, L<http://www.faqs.org/rfcs/>
753 L<http://www.unicode.org/>
757 =item Unicode Glossary
759 L<http://www.unicode.org/glossary/>
761 The glossary of this document is based upon this site.
767 =head2 Other Notable Sites
773 L<http://czyborra.com/>
775 Contains a a lot of useful information, especially gory details of ISO
780 L<http://www.oreilly.com/people/authors/lunde/cjk_inf.html>
782 Somewhat obsolete (last update in 1996), but still useful. Also try
784 L<ftp://ftp.oreilly.com/pub/examples/nutshell/cjkv/pdf/GB18030_Summary.pdf>
786 You will find brief info on C<EUC-CN>, C<GBK> and mostly on C<GB 18030>
788 =item Jungshik Shin's Hangul FAQ
790 L<http://jshin.net/faq>
792 And especially it's subject 8.
794 L<http://jshin.net/faq/qa8.html>
796 A comprehensive overview of the Korean (C<KS *>) standards.
800 =head2 Offline sources
804 =item C<CJKV Information Processing> by Ken Lunde
806 CJKV Information Processing
807 1999 O'Reilly & Associates, ISBN : 1-56592-224-7
809 The modern successor of the C<CJK.inf>.
811 Features a comprehensive coverage on CJKV character sets and
812 encodings along with many other issues faced by anyone trying
813 to better support CJKV languages/scripts in all the areas of
814 information processing.
816 To purchase this book visit
817 L<http://www.oreilly.com/catalog/cjkvinfo/>
823 I could not find this page because the hostname doesn't resolve!
825 Brief description for most of the mentioned CJK encodings
826 L<http://www.debian.org.ru/doc/manuals/intro-i18n/ch-codes.html>