兵藤です
base64.rbを見るとデコードのところで
str.gsub!(/\n/, ' ')
とあるのですが
RFC2047(Nov 1996) Message Header Extensions の
[Page 10]冒頭(6.2節Display of 'encoded-word'sの途中)と
[Page 12]末尾(8. Exampleの途中)には
encoded-word'sにはさまれた改行と空白は無視されるように読めます(↓)
以下引用
RFC 2047
When displaying a particular header field that contains multiple
'encoded-word's, any 'linear-white-space' that separates a pair of
adjacent 'encoded-word's is ignored. (This is to allow the use of
multiple 'encoded-word's to represent long strings of unencoded text,
without having to separate 'encoded-word's where spaces occur in the
unencoded text.)
RFC 822
LWSP-char = SPACE / HTAB ; semantics = SPACE
linear-white-space = 1*([CRLF] LWSP-char) ; semantics = SPACE
; CRLF => folding
# 昔私もlinear-white-spaceは1つの空白になるのだよと聞いたのですが
# (だからいまだにNetNewsで空白が混じったSubjectを書く人が現れる)
# どこかで定義が変わったのでしょうか
---
hyoudo / kcn.or.jp http://www.kcn.or.jp/~hyoudo/nextstep/ 兵藤公一