Today I got a question about 1522 encodings which I was
unable to answer, so I hope some of you can help me.
1522 states in section 5 that:
Ordinary ASCII text and encoded-words may appear together in the
same header field. However, an encoded-word that appears in a
header field defined as "*text" MUST be separated from any
adjacent encoded-word or "text" by linear-white-space.
and
A "Q"-encoded encoded-word which appears in a comment MUST NOT
contain the characters "(", ")" or " encoded-word that appears in
a "comment" MUST be separated from any adjacent encoded-word or
"ctext" by linear-white-space.
and in section 6.2
When displaying a particular header field that contains multiple
encoded-words, any linear-white-space that separates a pair of
adjacent encoded-words is ignored. (This is to allow the use of
multiple encoded-words to represent long strings of unencoded text,
without having to separate encoded-words where spaces occur in the
unencoded text.)
So, as far as I can see the line
=?US-ASCII?Q?Keith_?= =?US-ASCII?Q?Moore?=
Should be presented as
Keith Moore
...because the space between the encoded words should be deleted
when displaying the text. So, the space that must be there
must be in one of the encoded words.
But, what happens when you mix encoded words with text?
For example:
=?US-ASCII?Q?Keith_?= Moore
You must have space between the encoded word and the text, so
I presume that the spaces after the encoded word should be
deleted.
So, I would like the above string to be displayed as:
Keith Moore
But, the RFC sais as you can see that "linear whitespace", not
_one_ space character, is to be deleted so the encoded word:
=?US-ASCII?Q?Keith?= Moore
should be displayed as
KeithMoore
(note that the '_' is missing from this encoded word)
So, now my question/statement which I must have confirmed:
Any whitespace in a text that is to be encoded, or adjacing
to text that is to be encoded, must also be encoded?
Patrik