From 19919c3057dc8d54d05d7d5883e14833194a86c7 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 24 May 1999 15:33:02 +0000 Subject: [PATCH] fix CRLF <-> LF converter. --- TESTPAT-FLIM | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/TESTPAT-FLIM b/TESTPAT-FLIM index 649ddca..052f813 100644 --- a/TESTPAT-FLIM +++ b/TESTPAT-FLIM @@ -4,8 +4,19 @@ (if (< max-specpdl-size 1000) (setq max-specpdl-size 1000)) -(defun crlf-to-lf (str) (decode-coding-string str 'raw-text-dos)) -(defun lf-to-crlf (str) (encode-coding-string str 'raw-text-dos)) +(defun crlf-to-lf (str) + (funcall + (if (multibyte-string-p str) + 'string-as-multibyte + 'string-as-unibyte) + (decode-coding-string str 'raw-text-dos))) + +(defun lf-to-crlf (str) + (funcall + (if (multibyte-string-p str) + 'string-as-multibyte + 'string-as-unibyte) + (encode-coding-string str 'raw-text-dos))) (defun decode-flim (src &rest opts) (unless (memq 'embedded-encoded-word opts) @@ -21,7 +32,7 @@ (goto-char (point-min)) (std11-narrow-to-header mail-header-separator) (std11-field-end) - (string-as-multibyte (lf-to-crlf (std11-unfold-string (buffer-substring (point-min) (point)))))))) + (lf-to-crlf (std11-unfold-string (buffer-substring (point-min) (point))))))) (defun encode-flim (src &rest opts) (setq src (crlf-to-lf src)) -- 1.7.10.4