Debian Codegraph @

pypy/module/_multibytecodec/src/cjkcodecs/README

raw
1 Source
2 ------
3 The .c and .h files come directly from CPython, with the exception of
4 cjkcodecs.h and multibytecodec.h, which have been ripped of their
5 CPython dependencies.
6
7
8 To generate or modify mapping headers
9 -------------------------------------
10 Mapping headers are imported from CJKCodecs as pre-generated form.
11 If you need to tweak or add something on it, please look at tools/
12 subdirectory of CJKCodecs' distribution.
13
14
15
16 Notes on implmentation characteristics of each codecs
17 -----------------------------------------------------
18
19 1) Big5 codec
20
21 The big5 codec maps the following characters as cp950 does rather
22 than conforming Unicode.org's that maps to 0xFFFD.
23
24 BIG5 Unicode Description
25
26 0xA15A 0x2574 SPACING UNDERSCORE
27 0xA1C3 0xFFE3 SPACING HEAVY OVERSCORE
28 0xA1C5 0x02CD SPACING HEAVY UNDERSCORE
29 0xA1FE 0xFF0F LT DIAG UP RIGHT TO LOW LEFT
30 0xA240 0xFF3C LT DIAG UP LEFT TO LOW RIGHT
31 0xA2CC 0x5341 HANGZHOU NUMERAL TEN
32 0xA2CE 0x5345 HANGZHOU NUMERAL THIRTY
33
34 Because unicode 0x5341, 0x5345, 0xFF0F, 0xFF3C is mapped to another
35 big5 codes already, a roundtrip compatibility is not guaranteed for
36 them.
37
38
39 2) cp932 codec
40
41 To conform to Windows's real mapping, cp932 codec maps the following
42 codepoints in addition of the official cp932 mapping.
43
44 CP932 Unicode Description
45
46 0x80 0x80 UNDEFINED
47 0xA0 0xF8F0 UNDEFINED
48 0xFD 0xF8F1 UNDEFINED
49 0xFE 0xF8F2 UNDEFINED
50 0xFF 0xF8F3 UNDEFINED
51
52
53 3) euc-jisx0213 codec
54
55 The euc-jisx0213 codec maps JIS X 0213 Plane 1 code 0x2140 into
56 unicode U+FF3C instead of U+005C as on unicode.org's mapping.
57 Because euc-jisx0213 has REVERSE SOLIDUS on 0x5c already and A140
58 is shown as a full width character, mapping to U+FF3C can make
59 more sense.
60
61 The euc-jisx0213 codec is enabled to decode JIS X 0212 codes on
62 codeset 2. Because JIS X 0212 and JIS X 0213 Plane 2 don't have
63 overlapped by each other, it doesn't bother standard conformations
64 (and JIS X 0213 Plane 2 is intended to use so.) On encoding
65 sessions, the codec will try to encode kanji characters in this
66 order:
67
68 JIS X 0213 Plane 1 -> JIS X 0213 Plane 2 -> JIS X 0212
69
70
71 4) euc-jp codec
72
73 The euc-jp codec is a compatibility instance on these points:
74 - U+FF3C FULLWIDTH REVERSE SOLIDUS is mapped to EUC-JP A1C0 (vice versa)
75 - U+00A5 YEN SIGN is mapped to EUC-JP 0x5c. (one way)
76 - U+203E OVERLINE is mapped to EUC-JP 0x7e. (one way)
77
78
79 5) shift-jis codec
80
81 The shift-jis codec is mapping 0x20-0x7e area to U+20-U+7E directly
82 instead of using JIS X 0201 for compatibility. The differences are:
83 - U+005C REVERSE SOLIDUS is mapped to SHIFT-JIS 0x5c.
84 - U+007E TILDE is mapped to SHIFT-JIS 0x7e.
85 - U+FF3C FULL-WIDTH REVERSE SOLIDUS is mapped to SHIFT-JIS 815f.
86