]> code.delx.au - gnu-emacs/blob - admin/notes/unicode
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
[gnu-emacs] / admin / notes / unicode
1 -*-mode: text; coding: utf-8;-*-
2
3 Copyright (C) 2002-2015 Free Software Foundation, Inc.
4 See the end of the file for license conditions.
5
6 Importing a new Unicode Standard version into Emacs
7 -------------------------------------------------------------
8
9 Emacs uses the following files from the Unicode Character Database
10 (a.k.a. "UCD):
11
12 . UnicodeData.txt
13 . BidiMirroring.txt
14 . IVD_Sequences.txt
15
16 First, these files need to be copied into admin/unidata/, and then
17 Emacs should be rebuilt for them to take effect. Rebuilding Emacs
18 updates several derived files elsewhere in the Emacs source tree,
19 mainly in lisp/international/.
20
21 When Emacs is rebuilt for the first time after importing the new
22 files, pay attention to any warning or error messages. In particular,
23 admin/unidata/unidata-gen.el will complain if UnicodeData.txt defines
24 new bidirectional attributes of characters, because unidata-gen.el,
25 bidi.c and dispextern.h need to be updated in that case; failure to do
26 so will cause aborts in redisplay.
27
28 Next, review the changes in UnicodeData.txt vs the previous version
29 used by Emacs. Any changes, be it introduction of new scripts or
30 addition of codepoints to existing scripts, need corresponding changes
31 in the data used for filling char-script-table, see characters.el
32 around line 1300. Other databases and settings in characters.el, such
33 as the data for char-width-table, might also need changes.
34
35 Any new scripts added by UnicodeData.txt will also need updates to
36 script-representative-chars defined in fontset.el. Other databases in
37 fontset.el might also need to be updated as needed.
38
39 Problems, fixmes and other unicode-related issues
40 -------------------------------------------------------------
41
42 Notes by fx to record various things of variable importance. handa
43 needs to check them -- don't take too seriously, especially with
44 regard to completeness.
45
46 * SINGLE_BYTE_CHAR_P returns true for Latin-1 characters, which has
47 undesirable effects. E.g.:
48 (multibyte-string-p (let ((s "x")) (aset s 0 ?£) s)) => nil
49 (multibyte-string-p (concat [?£])) => nil
50 (text-char-description ?£) => "M-#"
51
52 These examples are all fixed by the change of 2002-10-14, but
53 there still exist questionable SINGLE_BYTE_CHAR_P in the
54 code (keymap.c and print.c).
55
56 * Rationalize character syntax and its relationship to the Unicode
57 database. (Applies mainly to symbol an punctuation syntax.)
58
59 * Fontset handling and customization needs work. We want to relate
60 fonts to scripts, probably based on the Unicode blocks. The
61 presence of small-repertoire 10646-encoded fonts in XFree 4 is a
62 pain, not currently worked round.
63
64 With the change on 2002-07-26, multiple fonts can be
65 specified in a fontset for a specific range of characters.
66 Each range can also be specified by script. Before using
67 ISO10646 fonts, Emacs checks their repertories to avoid such
68 fonts that don't have a glyph for a specific character.
69
70 fx has worked on fontset customization, but was stymied by
71 basic problems with the way the default face is dealt with
72 (and something else, I think). This needs revisiting.
73
74 * Work is also needed on charset and coding system priorities.
75
76 * The relevant bits of latin1-disp.el need porting (and probably
77 re-naming/updating). See also cyril-util.el.
78
79 * Quail files need more work now the encoding is largely irrelevant.
80
81 * What to do with the old coding categories stuff?
82
83 * The preferred-coding-system property of charsets should probably be
84 junked unless it can be made more useful now.
85
86 * find-multibyte-characters needs looking at.
87
88 * Implement Korean cp949/UHC, BIG5-HKSCS and any other important missing
89 charsets.
90
91 * Lazy-load tables for unify-charset somehow?
92
93 Actually, Emacs clears out all charset maps and unify-map just
94 before dumping, and they are loaded again on demand by the
95 dumped emacs. But, those maps (char tables) generated while
96 temacs is running can't be removed from the dumped emacs.
97
98 * iso-2022 charsets get unified on i/o.
99
100 With the change on 2003-01-06, decoding routines put `charset'
101 property to decoded text, and iso-2022 encoder pay attention
102 to it. Thus, for instance, reading and writing by
103 iso-2022-7bit preserve the original designation sequences.
104 The property name `preferred-charset' may be better?
105
106 We may have to utilize this property to decide a font.
107
108 * Revisit locale processing: look at treating the language and
109 charset parts separately. (Language should affect things like
110 spelling and calendar, but that's not a Unicode issue.)
111
112 * Handle Unicode combining characters usefully, e.g. diacritics, and
113 handle more scripts specifically (à la Devanagari). There are
114 issues with canonicalization.
115
116 * We need tabular input methods, e.g. for maths symbols. (Not
117 specific to Unicode.)
118
119 * Need multibyte text in menus, e.g. for the above. (Not specific to
120 Unicode -- see Emacs etc/TODO, but now mostly works with gtk.)
121
122 * There's currently no support for Unicode normalization.
123
124 * Populate char-width-table correctly for Unicode characters and
125 worry about what happens when double-width charsets covering
126 non-CJK characters are unified.
127
128 * There are type errors lurking, e.g. in
129 Fcheck_coding_systems_region. Define ENABLE_CHECKING to find them.
130
131 * Old auto-save files, and similar files, such as Gnus drafts,
132 containing non-ASCII characters probably won't be re-read correctly.
133
134
135 Source file encoding
136 --------------------
137
138 Most Emacs source files are encoded in UTF-8 (or in ASCII, which is a
139 subset), but there are a few exceptions, listed below. Perhaps
140 someday many of these files will be converted to UTF-8, for
141 convenience when using tools like 'grep -r', but this might need
142 nontrivial changes to the build process.
143
144 * chinese-big5
145
146 These are verbatim copies of files taken from external sources.
147 They haven't been converted to UTF-8.
148
149 leim/CXTERM-DIC/4Corner.tit
150 leim/CXTERM-DIC/ARRAY30.tit
151 leim/CXTERM-DIC/ECDICT.tit
152 leim/CXTERM-DIC/ETZY.tit
153 leim/CXTERM-DIC/PY-b5.tit
154 leim/CXTERM-DIC/Punct-b5.tit
155 leim/CXTERM-DIC/QJ-b5.tit
156 leim/CXTERM-DIC/ZOZY.tit
157 leim/MISC-DIC/CTLau-b5.html
158 leim/MISC-DIC/cangjie-table.b5
159
160 * chinese-iso-8bit
161
162 These are verbatim copies of files taken from external sources.
163 They haven't been converted to UTF-8.
164
165 leim/CXTERM-DIC/CCDOSPY.tit
166 leim/CXTERM-DIC/Punct.tit
167 leim/CXTERM-DIC/QJ.tit
168 leim/CXTERM-DIC/SW.tit
169 leim/CXTERM-DIC/TONEPY.tit
170 leim/MISC-DIC/CTLau.html
171 leim/MISC-DIC/pinyin.map
172 leim/MISC-DIC/ziranma.cin
173
174 * cp850
175
176 This file contains non-ASCII characters in unibyte strings. When
177 editing a keyboard layout it's more convenient to see 'é' than
178 '\202', and the MS-DOS compiler requires the single byte if a
179 backslash escape is not being used.
180
181 src/msdos.c
182
183 * iso-2022-cn-ext
184
185 This file is externally generated from leim/MISC-DIC/cangjie-table.b5
186 by Big5->CNS converter. It hasn't been converted to UTF-8.
187
188 leim/MISC-DIC/cangjie-table.cns
189
190 * japanese-iso-8bit
191
192 SKK-JISYO.L is a verbatim copy of a file taken from an external source.
193 It hasn't been converted to UTF-8.
194
195 leim/SKK-DIC/SKK-JISYO.L
196
197 * japanese-shift-jis
198
199 This is a verbatim copy of a file taken from an external source.
200 It hasn't been converted to UTF-8.
201
202 admin/charsets/mapfiles/cns2ucsdkw.txt
203
204 * iso-2022-7bit
205
206 This file switches between CJK charsets, which is not encoded in UTF-8.
207
208 etc/HELLO
209
210 Each of these files contains just one CJK charset, but Emacs
211 currently has no easy way to specify set-charset-priority on a
212 per-file basis, so converting any of these files to UTF-8 might
213 change the file's appearance when viewed by an Emacs that is
214 operating in some other language environment.
215
216 etc/tutorials/TUTORIAL.ja
217 lisp/international/ja-dic-cnv.el
218 lisp/international/ja-dic-utl.el
219 lisp/international/kinsoku.el
220 lisp/international/kkc.el
221 lisp/international/titdic-cnv.el
222 lisp/language/japan-util.el
223 lisp/language/japanese.el
224 lisp/leim/quail/cyril-jis.el
225 lisp/leim/quail/hanja-jis.el
226 lisp/leim/quail/japanese.el
227 lisp/leim/quail/py-punct.el
228 lisp/leim/quail/pypunct-b5.el
229
230 This file contains just Chinese characters, and has same problem.
231 Also, it contains characters that cannot be encoded in UTF-8.
232
233 lisp/international/titdic-cnv.el
234
235 * utf-8-emacs
236
237 These files contain characters that cannot be encoded in UTF-8.
238
239 lisp/language/ethio-util.el
240 lisp/language/ethiopic.el
241 lisp/language/ind-util.el
242 lisp/language/tibet-util.el
243 lisp/language/tibetan.el
244 lisp/leim/quail/ethiopic.el
245 lisp/leim/quail/tibetan.el
246
247 * binary files
248
249 These files contain binary data, and are not text files.
250 Some of the entries in this list are patterns, and stand for any
251 files with the listed extension.
252
253 *.gz
254 *.icns
255 *.ico
256 *.pbm
257 *.pdf
258 *.png
259 *.sig
260 etc/e/eterm-color
261 etc/package-keyring.gpg
262 msdos/emacs.pif
263 nextstep/GNUstep/Emacs.base/Resources/emacs.tiff
264 nt/icons/hand.cur
265
266 \f
267 This file is part of GNU Emacs.
268
269 GNU Emacs is free software: you can redistribute it and/or modify
270 it under the terms of the GNU General Public License as published by
271 the Free Software Foundation, either version 3 of the License, or
272 (at your option) any later version.
273
274 GNU Emacs is distributed in the hope that it will be useful,
275 but WITHOUT ANY WARRANTY; without even the implied warranty of
276 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
277 GNU General Public License for more details.
278
279 You should have received a copy of the GNU General Public License
280 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.