Re: [Ietf-http-auth] Updating RFC 2617 (HTTP Digest) to use UTF-8

* Julian Reschke wrote:
>Jim Luther schrieb:
>> While we're on this subject... In rfc2617 secction 3.2.1, it says:
>> 
>>> realm
>>>      A string to be displayed to users so they know which username and
>>>      password to use.
>> 
>> It would be also nice to define the encoding of the realm string so that 
>> clients that display the realm to users can display it correctly. We've 
>> seen realms from servers encoded UTF-8, ISO-8859-1, and with various 
>> Windows encodings. There's no good way to guess which encoding to use 
>> and so whatever is used is currently wrong on some servers.

>I was thinking "should be UTF-8, of course". But doesn't really RFC2045 
>apply here at least in theory?

The realm-value is a quoted-string, and quoted-string is defined as

       quoted-string  = ( <"> *(qdtext | quoted-pair ) <"> )
       qdtext         = <any TEXT except <">>

and TEXT is

   The TEXT rule is only used for descriptive field contents and values
   that are not intended to be interpreted by the message parser. Words
   of *TEXT MAY contain characters from character sets other than ISO-
   8859-1 [22] only when encoded according to the rules of RFC 2047
   [14].

       TEXT           = <any OCTET except CTLs,
                        but including LWS>

So you could use realm="=?utf-8?b?..." or its variants. As you say, in
theory; I am unaware of any implementation that supports encoded words
in HTTP headers..
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de
68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Tuesday, 26 September 2006 00:48:29 UTC