Mercurial > emacs
comparison lisp/international/codepage.el @ 24279:7334c513dc7d
(cp-coding-system-for-codepage-1): On MS-DOS,
use dos-unsupported-char-glyph for characters not
supported by the codepage.
(cp-make-coding-systems-for-codepage): Likewise.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Mon, 08 Feb 1999 11:21:00 +0000 |
parents | bb95d3d24ff9 |
children | 766feaa457a9 |
comparison
equal
deleted
inserted
replaced
24278:769617c7c4fd | 24279:7334c513dc7d |
---|---|
56 detection of the EOL format. However, the decoders and encoders created | 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 | 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)." | 58 variety is actually just an alias for the -unix variety)." |
59 (save-match-data | 59 (save-match-data |
60 (let* ((coding-name (symbol-name coding)) | 60 (let* ((coding-name (symbol-name coding)) |
61 (undef (if (eq system-type 'ms-dos) | |
62 (if dos-unsupported-char-glyph | |
63 (logand dos-unsupported-char-glyph 255) | |
64 127) | |
65 ??)) | |
61 (ccl-decoder-dos | 66 (ccl-decoder-dos |
62 (ccl-compile | 67 (ccl-compile |
63 `(4 (loop (read r1) | 68 `(4 (loop (read r1) |
64 (if (r1 != ?\r) | 69 (if (r1 != ?\r) |
65 (if (r1 >= 128) | 70 (if (r1 >= 128) |
87 (if (r1 == ?\n) | 92 (if (r1 == ?\n) |
88 (write ?\r) | 93 (write ?\r) |
89 (if (r0 != ,(charset-id 'ascii)) | 94 (if (r0 != ,(charset-id 'ascii)) |
90 ((translate-character ,encoder r0 r1) | 95 ((translate-character ,encoder r0 r1) |
91 (if (r0 == ,(charset-id 'japanese-jisx0208)) | 96 (if (r0 == ,(charset-id 'japanese-jisx0208)) |
92 ((r1 = ??) | 97 ((r1 = ,undef) |
93 (write r1)))))) | 98 (write r1)))))) |
94 (write-repeat r1))))) | 99 (write-repeat r1))))) |
95 (ccl-encoder-unix | 100 (ccl-encoder-unix |
96 (ccl-compile | 101 (ccl-compile |
97 `(1 (loop (read-multibyte-character r0 r1) | 102 `(1 (loop (read-multibyte-character r0 r1) |
98 (if (r0 != ,(charset-id 'ascii)) | 103 (if (r0 != ,(charset-id 'ascii)) |
99 ((translate-character ,encoder r0 r1) | 104 ((translate-character ,encoder r0 r1) |
100 (if (r0 == ,(charset-id 'japanese-jisx0208)) | 105 (if (r0 == ,(charset-id 'japanese-jisx0208)) |
101 ((r1 = ??) | 106 ((r1 = ,undef) |
102 (write r1))))) | 107 (write r1))))) |
103 (write-repeat r1)))))) | 108 (write-repeat r1)))))) |
104 (if (memq coding coding-system-list) | 109 (if (memq coding coding-system-list) |
105 (setq coding-system-list (delq coding coding-system-list))) | 110 (setq coding-system-list (delq coding coding-system-list))) |
106 | 111 |
434 (define-translation-table encode-translation | 439 (define-translation-table encode-translation |
435 (char-table-extra-slot (symbol-value nonascii-table) 0)) | 440 (char-table-extra-slot (symbol-value nonascii-table) 0)) |
436 ;; For charsets other than ascii and ISO-NAME, set `?' for | 441 ;; For charsets other than ascii and ISO-NAME, set `?' for |
437 ;; one-column charsets, and some Japanese character for | 442 ;; one-column charsets, and some Japanese character for |
438 ;; wide-column charsets. CCL encoder convert that Japanese | 443 ;; wide-column charsets. CCL encoder convert that Japanese |
439 ;; character to "??". | 444 ;; character to either dos-unsupported-char-glyph or "??". |
440 (let ((tbl (char-table-extra-slot (symbol-value nonascii-table) 0)) | 445 (let ((tbl (char-table-extra-slot (symbol-value nonascii-table) 0)) |
446 (undef (if (eq system-type 'ms-dos) | |
447 (if dos-unsupported-char-glyph | |
448 (logand dos-unsupported-char-glyph 255) | |
449 127) | |
450 ??)) | |
441 (charsets (delq 'ascii (delq iso-name | 451 (charsets (delq 'ascii (delq iso-name |
442 (copy-sequence charset-list)))) | 452 (copy-sequence charset-list)))) |
443 (wide-column-char (make-char 'japanese-jisx0208 32 32))) | 453 (wide-column-char (make-char 'japanese-jisx0208 32 32))) |
444 (while charsets | 454 (while charsets |
445 (aset tbl (make-char (car charsets)) | 455 (aset tbl (make-char (car charsets)) |
446 (if (= (charset-width (car charsets)) 1) ?? wide-column-char)) | 456 (if (= (charset-width (car charsets)) 1) undef wide-column-char)) |
447 (setq charsets (cdr charsets)))) | 457 (setq charsets (cdr charsets)))) |
448 (define-translation-table decode-translation | 458 (define-translation-table decode-translation |
449 (symbol-value nonascii-table)) | 459 (symbol-value nonascii-table)) |
450 (cp-coding-system-for-codepage-1 | 460 (cp-coding-system-for-codepage-1 |
451 (intern codepage) ?D iso-name decode-translation encode-translation) | 461 (intern codepage) ?D iso-name decode-translation encode-translation) |