changeset 90753:95971e7b3e24

Synch with HEAD.
author Kenichi Handa <handa@m17n.org>
date Wed, 14 Feb 2007 01:30:39 +0000
parents db735800b535
children e557d0f1b7b1
files lisp/international/titdic-cnv.el
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/titdic-cnv.el	Tue Feb 13 12:28:05 2007 +0000
+++ b/lisp/international/titdic-cnv.el	Wed Feb 14 01:30:39 2007 +0000
@@ -479,7 +479,9 @@
       (let ((standard-output (current-buffer)))
 	(with-temp-buffer
 	  (set-buffer-multibyte nil)
-	  (let ((coding-system-for-read 'no-conversion))
+	  ;; Here we must use `raw-text' instead of `no-conversion' to
+	  ;; enable auto-decoding of eol format (CRLF->LF).
+	  (let ((coding-system-for-read 'raw-text))
 	    (insert-file-contents (expand-file-name filename)))
 
 	  ;; Decode the buffer contents from the encoding specified by a
@@ -501,7 +503,9 @@
 	    (message "Decoding with coding system %s..." coding-system)
 	    (goto-char (point-min))
 	    (decode-coding-region (point-min) (point-max) coding-system)
-	    (setq coding-system-for-write coding-system)
+	    ;; Explicitly set eol format to `unix'.
+	    (setq coding-system-for-write
+		  (coding-system-change-eol-conversion coding-system 'unix))
 	    (remove-text-properties (point-min) (point-max) '(charset nil)))
 
 	  (set-buffer-multibyte t)
@@ -1143,7 +1147,9 @@
 	      converter (nth 5 slot)
 	      copyright (nth 6 slot))
 	(message "Converting %s to %s..." dicfile quailfile)
-	(setq coding-system-for-write coding)
+	;; Explicitly set eol format to `unix'.
+	(setq coding-system-for-write
+	      (coding-system-change-eol-conversion coding 'unix))
 	(with-temp-file (expand-file-name quailfile dirname)
 	  (insert (format ";; Quail package `%s' -*- coding:%s; " name coding))
 	  (insert "byte-compile-disable-print-circle:t; -*-\n")