2000-12-20 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+ * eword-encode.el (eword-encode-text): Specify `mode' of
+ `encoded-text-encode-string'.
+
+ * mel.el (encoded-text-encode-string): Add optional argument
+ `mode'; use `base64-encode-string' directly for "B"-encoding.
+
+2000-12-20 MORIOKA Tomohiko <tomo@kanji.zinbun.kyoto-u.ac.jp>
+
* FLIM-API.en: Renamed from FLIM-1.14-API.en; reordered and add
some sections.
ENCODING allows \"B\" or \"Q\".
MODE is allows `text', `comment', `phrase' or nil. Default value is
`phrase'."
- (let ((text (encoded-text-encode-string string encoding)))
+ (let ((text (encoded-text-encode-string string encoding mode)))
(if text
(concat "=?" (upcase (symbol-name charset)) "?"
encoding "?" text "?=")
(buffer-string))))
(or (bolp) (insert ?\n)))
- (mel-define-method-function (encoded-text-encode-string string (nil "B"))
- 'base64-encode-string)
+ ;; (mel-define-method-function (encoded-text-encode-string string (nil "B"))
+ ;; 'base64-encode-string)
(mel-define-method encoded-text-decode-string (string (nil "B"))
(if (string-match (eval-when-compile
(concat "\\`" B-encoded-text-regexp "\\'"))
string)))
-(mel-define-service encoded-text-encode-string (string encoding)
- "Encode STRING as encoded-text using ENCODING. ENCODING must be string.")
+(mel-define-service encoded-text-encode-string)
+(defun encoded-text-encode-string (string encoding &optional mode)
+ "Encode STRING as encoded-text using ENCODING.
+ENCODING must be string.
+Optional argument MODE allows `text', `comment', `phrase' or nil.
+Default value is `phrase'."
+ (if (string= encoding "B")
+ (base64-encode-string string 'no-line-break)
+ (let ((f (mel-find-function 'encoded-text-encode-string encoding)))
+ (if f
+ (funcall f string mode)
+ string))))
(mel-define-service encoded-text-decode-string (string encoding)
"Decode STRING as encoded-text using ENCODING. ENCODING must be string.")