From a7bc7c2a69a452d7fa57ee3f4d2ad47ae44b0cb5 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 8 Feb 1999 11:21:00 +0000 Subject: [PATCH] (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. --- lisp/international/codepage.el | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lisp/international/codepage.el b/lisp/international/codepage.el index f4990ec2104..9d5e7872cb6 100644 --- a/lisp/international/codepage.el +++ b/lisp/international/codepage.el @@ -58,6 +58,11 @@ for these coding systems only support DOS and Unix style EOLs (the -mac variety is actually just an alias for the -unix variety)." (save-match-data (let* ((coding-name (symbol-name coding)) + (undef (if (eq system-type 'ms-dos) + (if dos-unsupported-char-glyph + (logand dos-unsupported-char-glyph 255) + 127) + ??)) (ccl-decoder-dos (ccl-compile `(4 (loop (read r1) @@ -89,7 +94,7 @@ variety is actually just an alias for the -unix variety)." (if (r0 != ,(charset-id 'ascii)) ((translate-character ,encoder r0 r1) (if (r0 == ,(charset-id 'japanese-jisx0208)) - ((r1 = ??) + ((r1 = ,undef) (write r1)))))) (write-repeat r1))))) (ccl-encoder-unix @@ -98,7 +103,7 @@ variety is actually just an alias for the -unix variety)." (if (r0 != ,(charset-id 'ascii)) ((translate-character ,encoder r0 r1) (if (r0 == ,(charset-id 'japanese-jisx0208)) - ((r1 = ??) + ((r1 = ,undef) (write r1))))) (write-repeat r1)))))) (if (memq coding coding-system-list) @@ -436,14 +441,19 @@ decoder and encoder created by this function." ;; For charsets other than ascii and ISO-NAME, set `?' for ;; one-column charsets, and some Japanese character for ;; wide-column charsets. CCL encoder convert that Japanese - ;; character to "??". + ;; character to either dos-unsupported-char-glyph or "??". (let ((tbl (char-table-extra-slot (symbol-value nonascii-table) 0)) + (undef (if (eq system-type 'ms-dos) + (if dos-unsupported-char-glyph + (logand dos-unsupported-char-glyph 255) + 127) + ??)) (charsets (delq 'ascii (delq iso-name (copy-sequence charset-list)))) (wide-column-char (make-char 'japanese-jisx0208 32 32))) (while charsets (aset tbl (make-char (car charsets)) - (if (= (charset-width (car charsets)) 1) ?? wide-column-char)) + (if (= (charset-width (car charsets)) 1) undef wide-column-char)) (setq charsets (cdr charsets)))) (define-translation-table decode-translation (symbol-value nonascii-table)) -- 2.39.2