From bc581e91cbabbebf5827068f3851678a05e4207f Mon Sep 17 00:00:00 2001 From: morioka Date: Mon, 10 Aug 1998 18:06:33 +0000 Subject: [PATCH] (decode-mime-charset-region): Add new argument `lbt'. (decode-mime-charset-string): Likewise. --- emu-latin1.el | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/emu-latin1.el b/emu-latin1.el index e47ff64..5c0d151 100644 --- a/emu-latin1.el +++ b/emu-latin1.el @@ -216,17 +216,31 @@ find-file-hooks, etc. "Encode the text between START and END as MIME CHARSET." ) -(defun decode-mime-charset-region (start end charset) +(defun decode-mime-charset-region (start end charset &optional lbt) "Decode the text between START and END as MIME CHARSET." + (cond ((eq lbt 'CRLF) + (save-excursion + (save-restriction + (narrow-to-region start end) + (goto-char (point-min)) + (while (search-forward "\r\n" nil t) + (replace-match "\n")) + )))) ) (defun encode-mime-charset-string (string charset) "Encode the STRING as MIME CHARSET." string) -(defun decode-mime-charset-string (string charset) +(defun decode-mime-charset-string (string charset &optional lbt) "Decode the STRING as MIME CHARSET." - string) + (if lbt + (with-temp-buffer + (insert string) + (decode-mime-charset-region (point-min)(point-max) charset lbt) + (buffer-string) + ) + string)) (defalias 'write-region-as-mime-charset 'write-region) -- 1.7.10.4