+2000-11-09 16:20:37 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * rfc2047.el (rfc2047-pad-base64): New function.
+ (rfc2047-decode): Use it.
+
+2000-11-09 08:53:04 ShengHuo ZHU <zsh@cs.rochester.edu>
+
+ * gnus-srvr.el (gnus-browse-foreign-server): Bind the original
+ select method.
+
2000-11-08 19:58:58 ShengHuo ZHU <zsh@cs.rochester.edu>
* mml2015.el (mml2015-gpg-decrypt-1):
(insert
(format "%c%7d: %s\n"
(let ((level
- (gnus-group-level
- (gnus-group-prefixed-name (car group) method))))
- (cond
- ((<= level gnus-level-subscribed) ? )
- ((<= level gnus-level-unsubscribed) ?U)
- ((= level gnus-level-zombie) ?Z)
- (t ?K)))
+ (let ((gnus-select-method orig-select-method))
+ (gnus-group-level
+ (gnus-group-prefixed-name (car group)
+ method)))))
+ (cond
+ ((<= level gnus-level-subscribed) ? )
+ ((<= level gnus-level-unsubscribed) ?U)
+ ((= level gnus-level-zombie) ?Z)
+ (t ?K)))
(max 0 (- (1+ (cddr group)) (cadr group)))
(gnus-group-name-decode (car group) charset))))
(list 'gnus-group (car group)))
(error word))
word)))
+(defun rfc2047-pad-base64 (string)
+ "Pad STRING to quartets."
+ ;; Be more liberal to accept buggy base64 strings. If
+ ;; base64-decode-string accepts buggy strings, this function could
+ ;; be aliased to identity.
+ (case (mod (length string) 4)
+ (0 string)
+ (1 string) ;; Error, don't pad it.
+ (2 (concat string "=="))
+ (3 (concat string "="))))
+
(defun rfc2047-decode (charset encoding string)
"Decode STRING that uses CHARSET with ENCODING.
Valid ENCODINGs are \"B\" and \"Q\".
(mm-decode-coding-string
(cond
((equal "B" encoding)
- (base64-decode-string string))
+ (base64-decode-string
+ (rfc2047-pad-base64 string)))
((equal "Q" encoding)
(quoted-printable-decode-string
(mm-replace-chars-in-string string ?_ ? )))