Re: header un-folding & encoded headers

Keith Moore <[email protected]>
Newsgroups gmane.ietf.rfc822
Message-ID <[email protected]>
it's simple:

1. white space between two adjacent encoded-words is not displayed.
2. white space between an encoded-word and an ordinary rfc822 atom is 
displayed.

Keith


Paul Smith wrote:
> 
> I'm just struggling slightly to work out how you're meant to handle the 
> following situation. It seems a bit inconsistent, so I want to check I'm 
> interpreting it right.
> 
> If I have a header
> 
> Subject: hello
> there
> (no space after 'hello' and one space before 'there')
> 
> I should unwrap that to
> 
> Subject: hello there
> 
> (one space between 'hello' and 'there' - ie just remove the CRLF as 
> stated in RFC 2822 2.2.3)
> Yes?
> 
> ----
> 
> If I have a header
> 
> Subject: =?us-ascii?Q?hello?= =?us-ascii?Q?there?=
> 
> (two encoded words with no spaces in them, and a space between them) I 
> should decode that to
> 
> Subject: hello there
> 
> Yes?
> (to be honest, I'm not entirely sure about this because 'Subject: 
> =?us-ascii?Q?hello?=there' (without a space) is illegal, so if you 
> wanted that would you use 'Subject: =?us-ascii?Q?hello?= there' instead 
> and expect the space to be stripped out or can you just not do it - 
> section 5(1) of RFC 2047 isn't clear whether the separating LWS is 
> retained or not)
> 
> ----
> If I have a header
> 
> Subject: =?us-ascii?Q?hello?=
> =?us-ascii?Q?there?=
> (no space after the encoded 'hello' and one space before the encoded 
> 'there')
> 
> As I read it, I should decode it to
> Subject: hellothere
> i.e. in this case I should discard the CRLF *and* the space, so I can't 
> just unwrap it, and then decode as the space would be kept then.
> 
> Yes?
> 
> ----
> If so, what about
> 
> Subject: hello
> =?us-ascii?Q?there?=
> 
> or
> 
> Subject: =?us-ascii?Q?hello?=
> there
> 
> Do I keep the space after the CRLF in these situations or not?
> 
> RFC 2047 seems to ignore this little side effect of header folding, 
> although it says that wrapping should be used to make sure that no 
> encoded-word is longer than 76 characters.
> 
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.