diff options
| author | Eli Zaretskii | 2000-06-25 10:09:30 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2000-06-25 10:09:30 +0000 |
| commit | 0ac646aa18fc3b68af5f4616ad685f6e858901bc (patch) | |
| tree | 5ca12b1303c2f9660e43ffa1253b87e8b78d6173 /lisp | |
| parent | b8c2455611f3245dffeb3e2230d8a3d101fd0323 (diff) | |
| download | emacs-0ac646aa18fc3b68af5f4616ad685f6e858901bc.tar.gz emacs-0ac646aa18fc3b68af5f4616ad685f6e858901bc.zip | |
(cp-coding-system-for-codepage-1): Doc fix.
(cp864-decode-table): Doc fix.
(cp720-decode-table): New variable, supports the Arabic OEM
codepage used by Windows.
(cp737-decode-table): New, Greek OEM codepage used by Windows.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/international/codepage.el | 66 |
1 files changed, 45 insertions, 21 deletions
diff --git a/lisp/international/codepage.el b/lisp/international/codepage.el index 0243bb8fb3a..5f4b76fe6e7 100644 --- a/lisp/international/codepage.el +++ b/lisp/international/codepage.el | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | ;;; codepage.el --- MS-DOS specific coding systems. | 1 | ;;; codepage.el --- MS-DOS/MS-Windows specific coding systems. |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1998 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1998 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Eli Zaretskii | 5 | ;; Author: Eli Zaretskii |
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| 7 | ;; Keywords: i18n ms-dos codepage | 7 | ;; Keywords: i18n ms-dos ms-windows codepage |
| 8 | 8 | ||
| 9 | ;; This file is part of GNU Emacs. | 9 | ;; This file is part of GNU Emacs. |
| 10 | 10 | ||
| @@ -25,16 +25,16 @@ | |||
| 25 | 25 | ||
| 26 | ;;; Commentary: | 26 | ;;; Commentary: |
| 27 | 27 | ||
| 28 | ;; Special coding systems for DOS codepage support. | 28 | ;; Special coding systems for DOS/Windows codepage support. |
| 29 | ;; | 29 | ;; |
| 30 | ;; These coding systems perform conversion from the DOS codepage encoding | 30 | ;; These coding systems perform conversion from the DOS/Windows |
| 31 | ;; to one of the ISO-8859 character sets. Each codepage has its corresponding | 31 | ;; codepage encoding to one of the ISO-8859 character sets. Each |
| 32 | ;; ISO-8859 charset, chosen so as to be able to convert all (or most) of the | 32 | ;; codepage has its corresponding ISO-8859 charset, chosen so as to be |
| 33 | ;; characters. The idea is that Emacs internally works with the usual MULE | 33 | ;; able to convert all (or most) of the characters. The idea is that |
| 34 | ;; charsets, and the conversion to and from the DOS codepage is performed | 34 | ;; Emacs internally works with the usual MULE charsets, and the |
| 35 | ;; on I/O only. | 35 | ;; conversion to and from the DOS codepage is performed on I/O only. |
| 36 | ;; See term/internal.el for the complementary setup of the DOS terminal | 36 | ;; See term/internal.el for the complementary setup of the DOS |
| 37 | ;; display and input methods. | 37 | ;; terminal display and input methods. |
| 38 | ;; | 38 | ;; |
| 39 | ;; Thanks to Ken'ichi Handa <handa@etl.go.jp> for writing the CCL | 39 | ;; Thanks to Ken'ichi Handa <handa@etl.go.jp> for writing the CCL |
| 40 | ;; encoders/decoders, and for help in debugging this code. | 40 | ;; encoders/decoders, and for help in debugging this code. |
| @@ -50,12 +50,7 @@ codepage. | |||
| 50 | DECODER is a translation table for converting characters in the DOS codepage | 50 | DECODER is a translation table for converting characters in the DOS codepage |
| 51 | encoding to Emacs multibyte characters. | 51 | encoding to Emacs multibyte characters. |
| 52 | ENCODER is a translation table for encoding Emacs multibyte characters into | 52 | ENCODER is a translation table for encoding Emacs multibyte characters into |
| 53 | external DOS codepage codes. | 53 | external DOS codepage codes." |
| 54 | |||
| 55 | Note that the coding systems created by this function support automatic | ||
| 56 | detection of the EOL format. However, the decoders and encoders created | ||
| 57 | for these coding systems only support DOS and Unix style EOLs (the -mac | ||
| 58 | variety is actually just an alias for the -unix variety)." | ||
| 59 | (save-match-data | 54 | (save-match-data |
| 60 | (let* ((coding-name (symbol-name coding)) | 55 | (let* ((coding-name (symbol-name coding)) |
| 61 | (undef (if (eq system-type 'ms-dos) | 56 | (undef (if (eq system-type 'ms-dos) |
| @@ -67,7 +62,7 @@ variety is actually just an alias for the -unix variety)." | |||
| 67 | (ccl-compile | 62 | (ccl-compile |
| 68 | ;; The 4 here supplies the buf_magnification parameter | 63 | ;; The 4 here supplies the buf_magnification parameter |
| 69 | ;; for the CCL program. A multibyte character may take | 64 | ;; for the CCL program. A multibyte character may take |
| 70 | ;; at most 4-byte. | 65 | ;; at most 4-bytes. |
| 71 | `(4 (loop (read r1) | 66 | `(4 (loop (read r1) |
| 72 | (if (r1 >= 128) | 67 | (if (r1 >= 128) |
| 73 | ((r0 = ,(charset-id 'ascii)) | 68 | ((r0 = ,(charset-id 'ascii)) |
| @@ -300,7 +295,7 @@ character is generated by (make-char CHARSET OFFSET)." | |||
| 300 | (defvar cp862-decode-table | 295 | (defvar cp862-decode-table |
| 301 | ;; Nth element is the code of a cp862 glyph for the multibyte | 296 | ;; Nth element is the code of a cp862 glyph for the multibyte |
| 302 | ;; character created by (make-char 'hebrew-iso8859-8 (+ N 160)). | 297 | ;; character created by (make-char 'hebrew-iso8859-8 (+ N 160)). |
| 303 | ;; The element nil means there's no corresponding cp850 glyph. | 298 | ;; The element nil means there's no corresponding cp862 glyph. |
| 304 | [ | 299 | [ |
| 305 | 255 173 155 156 nil 157 179 nil nil nil nil 174 170 196 nil nil | 300 | 255 173 155 156 nil 157 179 nil nil nil nil 174 170 196 nil nil |
| 306 | 248 241 253 nil nil 230 nil 249 nil nil 246 175 172 171 nil nil | 301 | 248 241 253 nil nil 230 nil 249 nil nil 246 175 172 171 nil nil |
| @@ -336,10 +331,26 @@ character is generated by (make-char CHARSET OFFSET)." | |||
| 336 | 208 209 210 188 189 190 235 215 216 223 238 nil nil nil nil nil | 331 | 208 209 210 188 189 190 235 215 216 223 238 nil nil nil nil nil |
| 337 | 224 247 248 252 251 239 242 243 232 233 253 nil nil nil nil nil | 332 | 224 247 248 252 251 239 242 243 232 233 253 nil nil nil nil nil |
| 338 | nil 241 nil nil nil nil nil nil nil nil nil nil nil nil nil nil] | 333 | nil 241 nil nil nil nil nil nil nil nil nil nil nil nil nil nil] |
| 339 | "Table for converting ISO-8859-1 characters into codepage 863 glyphs.") | 334 | "Table for converting ISO-8859-6 characters into codepage 864 glyphs.") |
| 340 | (setplist 'cp864-decode-table | 335 | (setplist 'cp864-decode-table |
| 341 | '(charset arabic-iso8859-6 language nil offset 160)) | 336 | '(charset arabic-iso8859-6 language nil offset 160)) |
| 342 | 337 | ||
| 338 | ;; Arabic OEM codepage used by Windows | ||
| 339 | ;; FIXME: Emacs doesn't seem to support the "Arabic" language | ||
| 340 | ;; environment yet. So this is only partially usable, for now | ||
| 341 | (defvar cp720-decode-table | ||
| 342 | [ | ||
| 343 | 255 nil nil nil 148 nil nil nil nil nil nil nil nil 196 nil nil | ||
| 344 | nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil nil | ||
| 345 | nil 152 153 154 155 157 158 159 160 161 162 163 164 165 166 167 | ||
| 346 | 168 169 170 171 172 173 224 225 226 227 228 nil nil nil nil nil | ||
| 347 | 149 229 231 232 233 234 235 236 237 238 239 241 242 243 244 245 | ||
| 348 | 246 145 146 nil nil nil nil nil nil nil nil nil nil nil nil nil] | ||
| 349 | "Table for converting ISO-8859-6 characters into codepage 720 glyphs.") | ||
| 350 | (setplist 'cp720-decode-table | ||
| 351 | '(charset arabic-iso8859-6 language nil offset 160)) | ||
| 352 | |||
| 353 | |||
| 343 | ;; Nordic (Norwegian/Danish) | 354 | ;; Nordic (Norwegian/Danish) |
| 344 | (defvar cp865-decode-table | 355 | (defvar cp865-decode-table |
| 345 | [ | 356 | [ |
| @@ -366,6 +377,19 @@ character is generated by (make-char CHARSET OFFSET)." | |||
| 366 | (setplist 'cp869-decode-table | 377 | (setplist 'cp869-decode-table |
| 367 | '(charset greek-iso8859-7 language "Greek" offset 160)) | 378 | '(charset greek-iso8859-7 language "Greek" offset 160)) |
| 368 | 379 | ||
| 380 | ;; Greek OEM codepage used by Windows | ||
| 381 | (defvar cp737-decode-table | ||
| 382 | [ | ||
| 383 | 255 nil nil nil nil nil 179 nil nil nil nil nil nil 196 nil nil | ||
| 384 | 248 241 253 nil nil nil 234 250 235 236 237 nil 238 nil 239 240 | ||
| 385 | nil 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 | ||
| 386 | 143 144 nil 145 146 147 148 149 150 151 244 245 225 226 227 229 | ||
| 387 | nil 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | ||
| 388 | 167 168 170 169 171 172 173 174 175 224 228 232 230 231 233 nil] | ||
| 389 | "Table for converting ISO-8859-7 characters into codepage 737 glyphs.") | ||
| 390 | (setplist 'cp737-decode-table | ||
| 391 | '(charset greek-iso8859-7 language "Greek" offset 160)) | ||
| 392 | |||
| 369 | ;; Conversion from codepage 775 to Latin-4 for Baltic countries. | 393 | ;; Conversion from codepage 775 to Latin-4 for Baltic countries. |
| 370 | (defvar cp775-decode-table | 394 | (defvar cp775-decode-table |
| 371 | [ | 395 | [ |
| @@ -383,7 +407,7 @@ character is generated by (make-char CHARSET OFFSET)." | |||
| 383 | ;; butchered from the ISO-8859 specs. This does not add support for | 407 | ;; butchered from the ISO-8859 specs. This does not add support for |
| 384 | ;; the extended characters that MS has added in the 128 - 159 coding | 408 | ;; the extended characters that MS has added in the 128 - 159 coding |
| 385 | ;; range, only translates those characters that can be expressed in | 409 | ;; range, only translates those characters that can be expressed in |
| 386 | ;; the corresponding iso-8859 codepage. | 410 | ;; the corresponding iso-8859 charset. |
| 387 | 411 | ||
| 388 | ;; Codepage Mapping: | 412 | ;; Codepage Mapping: |
| 389 | ;; | 413 | ;; |