Glenn Linderman wrote: > On approximately 10/8/2009 8:47 PM, came the following characters from > the keyboard of Tokio Kikuchi: >>>> Actually, as long as the prepended text is ASCII, all that work can be >>>> done on the encoded value. When it is not ASCII, it may still be >>>> separated and recognizable. Still that logic is more complex than >>>> decoding, handling as Unicode, and encoding.... when it works. Just >>>> pointing out that there is more than one way to do things... >> >> Oh, really? >> >> Base64 is 3 to 4 octets encoding and there is no way to prepend padding. >> > > In header values, encoding is done using encoded-words. A header value > consists of a sequence of ASCII words, and encoded-words. While an > encoded word, that uses base64 encoding cannot easily be adjusted to > prepend data into that encoded-word, additional ASCII or encoded-words > can be prepended in front of the other ASCII or encoded words within the > header-value. > > So, yes, really! > Following two lines have equivalent header contents:
Re: [mmjp-users 123] =?iso-2022-jp?b?GyRCRnxLXDhsGyhC?= Re: =?iso-2022-jp?b?W21tanAtdXNlcnMgMTIzXSAbJEJGfEtcOGwbKEI=?= I'd like to see how you can extract ascii part without touching rest of the encoded word in the second example. What we do in mailman is that both are treated equally and delete [mmjp-users 123] from the subject and prefix again by [mmjp-users 124] (with new sequential number). Some MUA encode subjects like the second example and this is beyond our control. Therefore, we are forced to decode the whole part of header content. -- Tokio Kikuchi, tkiku...@is.kochi-u.ac.jp http://weather.is.kochi-u.ac.jp/ _______________________________________________ Email-SIG mailing list Email-SIG@python.org Your options: http://mail.python.org/mailman/options/email-sig/archive%40mail-archive.com