Re: First strawman for UTF-8 headers proposal

Keith Moore <[email protected]> Sat, 3 Jan 2004 11:52:30 -0500
Newsgroups gmane.ietf.imaa
Message-ID <[email protected]>
>> One simple example.  Bernstein and others have pointed out that it's 
>> easier to parse header fields with address lists from the right to 
>> the left rather than from the left to the right, because this 
>> requires less lookahead.  It's still possible to do this with UTF-8 
>> (particularly if you do lexical analysis left-to-right and parsing 
>> right-to-left), but it's probably not a trivial change to existing 
>> code.
>
> If we're talking about "trivial changes to existing code", then yes, 
> the change is trivial: You add 128-255 to comment, atom, and 
> quoted-string (or more specifically in 2822, atext, ctext, dtext, 
> qtext, and text) and you're done. You can still treat the field 
> contents as octets. And in fact, if your code is just looking for 
> specials and has an 'else' clause for all the other octets, it might 
> need no coding changes at all.

yes, this will work in some cases, though you might get bitten if some 
kinds of atoms (or atext, whatever) can contain utf-8 and other kinds 
cannot.  it even appears to work for gb18030.