Parent Directory
|
Revision Log
2002-10-13 Wakaba <w@suika.fam.cx> * JISCompatible.esr: New file. * Makefile: New file.
| 1 | wakaba | 1.1 | #?PESRC/1.0 |
| 2 | Name: | ||
| 3 | ISO2022::JISCompatible | ||
| 4 | ShortDescription: | ||
| 5 | An Encode module of ISO/IEC 2022 | ||
| 6 | based compatible coding systems for Japanese | ||
| 7 | POD:DESCRIPTION: | ||
| 8 | Due to the historical reason, some of current | ||
| 9 | implementions of JIS coded character sets support | ||
| 10 | pairs of same characters dupplicately, with | ||
| 11 | halfwidth/fullwidth property. | ||
| 12 | |||
| 13 | Even this situation is undesirable, we can't ignore | ||
| 14 | such historical implementions and latest JIS coded | ||
| 15 | character set standards admire such dupulicate | ||
| 16 | encoding to and only to "keep compatibility with | ||
| 17 | current practice." | ||
| 18 | |||
| 19 | This module provides encoder and decoder for such | ||
| 20 | coding systems that comform to JIS and that based | ||
| 21 | on ISO/IEC 2022 structure. | ||
| 22 | |||
| 23 | Those coding systems SHOULD not be used for new | ||
| 24 | implemention or new data. They may not comform | ||
| 25 | to future version of JIS or other standards. | ||
| 26 | |||
| 27 | { | ||
| 28 | Name: | ||
| 29 | iso-2022-jp-3-fullwidth | ||
| 30 | Encode: | ||
| 31 | use:Encode::ISO2022::SevenBit | ||
| 32 | =>ucs_to_ascii ucs_to_jisx0213_2000_1_irv ucs_to_jisx0213_2000_2 | ||
| 33 | ->iso-2022-jp-3 | ||
| 34 | Decode: | ||
| 35 | use:Encode::ISO2022::SevenBit | ||
| 36 | <-iso-2022-jp-3 | ||
| 37 | <=jisx0213_2000_1_irv_to_ucs jisx0213_2000_2_to_ucs jisx0208_1997_irv_to_ucs | ||
| 38 | Description: | ||
| 39 | ISO/IEC 2022 based 7-bit encoding for Japanese, | ||
| 40 | ISO/IEC 646 IRV + JIS X 0213:2000. Some characters | ||
| 41 | defined in JIS X 0213 are mapped to FULLWIDTH or | ||
| 42 | HALFWIDTH area of UCS as specified in JIS X 0213:2000. | ||
| 43 | |||
| 44 | This encoding is a "compatible" version of | ||
| 45 | C<iso-2022-jp-3> defined in Encode::ISO2022::SevenBit. | ||
| 46 | } | ||
| 47 | |||
| 48 | { | ||
| 49 | Name: | ||
| 50 | euc-jp-1997-fullwidth | ||
| 51 | Alias: | ||
| 52 | euc-japan-1997-fullwidth euc-jp-1990-fullwidth euc-japan-1990-fullwidth | ||
| 53 | Encode: | ||
| 54 | =>ucs_to_ascii ucs_to_jisx0208_1997_irv ucs_to_jisx0212_1990_irv ucs_to_jisx0201_katakana_hw | ||
| 55 | ->euc-jp-1997 | ||
| 56 | Decode: | ||
| 57 | <-euc-jp-1997 | ||
| 58 | <=jisx0208_1997_irv_to_ucs jisx0212_1990_irv_to_ucs jisx0201_katakana_hw_to_ucs | ||
| 59 | Description: | ||
| 60 | EUC (ISO/IEC 2022 based 8-bit encoding) for Japanese, | ||
| 61 | ISO/IEC 646 IRV + JIS X 0208:1997 + JIS X 0212-1990 | ||
| 62 | + JIS X 0201:1997 Katakana. Some characters defined | ||
| 63 | in JIS X 0208 and all characters defined in JIS X 0201 | ||
| 64 | are mapped to FULLWIDTH or HALFWIDTH characters of UCS | ||
| 65 | as specified by JIS X 0221-1995 and JIS X 0208:1997. | ||
| 66 | |||
| 67 | This encoding is a "compatible" version of | ||
| 68 | C<euc-jp-1997> defined in Encode::ISO2022::EightBit. | ||
| 69 | } | ||
| 70 | |||
| 71 | { | ||
| 72 | Name: | ||
| 73 | euc-jisx0213-fullwidth | ||
| 74 | Alias: | ||
| 75 | euc-japan-2000-fullwidth euc-jp-2000-fullwidth | ||
| 76 | Encode: | ||
| 77 | use:Encode::ISO2022::EightBit | ||
| 78 | =>ucs_to_ascii ucs_to_jisx0213_2000_1_irv ucs_to_jisx0213_2000_2 ucs_to_jisx0201_katakana_hw | ||
| 79 | ->euc-jisx0213 | ||
| 80 | Decode: | ||
| 81 | use:Encode::ISO2022::EightBit | ||
| 82 | <-euc-jisx0213 | ||
| 83 | <=jisx0213_2000_1_irv_to_ucs jisx0213_2000_2_to_ucs jisx0201_katakana_hw_to_ucs | ||
| 84 | Description: | ||
| 85 | EUC (ISO/IEC 2022 based 8-bit encoding) for Japanese, | ||
| 86 | ISO/IEC 646 IRV + JIS X 0213:2000 + JIS X 0201:1997 | ||
| 87 | Katakana. Some characters defined in JIS X 0213 and | ||
| 88 | all characters defined in JIS X 0201 are mapped to | ||
| 89 | FULLWIDTH or HALFWIDTH characters of UCS as specified | ||
| 90 | by JIS X 0213:2000. | ||
| 91 | |||
| 92 | This encoding is a "compatible" version of | ||
| 93 | C<euc-jisx0213> defined in Encode::ISO2022::EightBit. | ||
| 94 | } | ||
| 95 | |||
| 96 | POD:EXAMPLE: | ||
| 97 | use %%MYSELF%%; | ||
| 98 | while (<>) { | ||
| 99 | print "FW-> : ". Encode::encode ('euc-jp-1997', Encode::decode ('euc-jp-1997-fullwidth', $_)); | ||
| 100 | print "FW->FW: ". Encode::encode ('euc-jp-1997-fullwidth', Encode::decode ('euc-jp-1997-fullwidth', $_)); | ||
| 101 | print " ->FW: ". Encode::encode ('euc-jp-1997-fullwidth', Encode::decode ('euc-jp-1997', $_)); | ||
| 102 | print " -> : ". Encode::encode ('euc-jp-1997', Encode::decode ('euc-jp-1997', $_)); | ||
| 103 | } | ||