From: "NARUSE, Yui" Date: 2011-11-24T19:30:07+09:00 Subject: [ruby-core:41284] Re: [ruby-trunk - Feature #2567] Net::HTTP does not handle encoding correctly 2011/11/24 Ricardo Amorim : > > Issue #2567 has been updated by Ricardo Amorim. > > > Yui NARUSE wrote: >> It shouldn't effect because URI doesn't include non ASCII character. >> If you are talking about an existing implementation which sends Location header with non ASCII characters, >> such talk should be on real research. > > I've seen a few ASP applications that do that. They redirect to a generic error page with an error message as an argument. e.g. below: > Location: error_page.asp?msg="P�gina com erro". Is such a string always ISO-8859-1 other than non US/West Europe? > Well doing some research I've found: > http://tools.ietf.org/html/draft-ietf-httpbis-p1-messaging-17#section-3.2.1 > > "Historically, HTTP has allowed field content with text in the ISO- > �8859-1 [ISO-8859-1] character encoding and supported other character > �sets only through use of [RFC2047] encoding. �In practice, most HTTP > �header field values use only a subset of the US-ASCII character > �encoding [USASCII]. �Newly defined header fields SHOULD limit their > �field values to US-ASCII octets. �Recipients SHOULD treat other (obs- > �text) octets in field content as opaque data." > > It's not entirely clear if non US-ASCII chars are allowed in field contents. The sentence seems to talk about fields which allow non ASCII but usually use only ASCII. So Location is also on this context. And the encoding for "opaque data" should be ASCII-8BIT. -- NARUSE, Yui �