M
Mark
Hi...
I'm a little perplexed. <%@Codepage="65001" %> changes how IIS/ASP will
handle interpreting query string variables - i.e. it will read the
querystring as being utf-8 encoded.
However, I'm finding that it *doesn't* change how Response.Cookies or
Request.Cookies get read/written.
I've been testing with a little jscript asp page with the lines
if (String (Request.QueryString ("abc")) != "undefined")
Response.Cookies("abc") = Request.QueryString ("abc");
Response.Write (Request.QueryString ("abc"));
to take a value from the query string and pass it back out as a cookie. The
test value I was using was r%c3%a9sume (resume with an accented e). When the
code page is set to utf-8, it will properly interpret the urlencoded query as
a utf-8 string. It will output the right bytes with Response.Write.
But watching the headers produced by the request, it comes out encoded in
latin-1.
Set-Cookie: abc=r%E9sume; path=/
I checked the cookie rfc on w3c.org, and oddly it doesn't say much about how
to encode/interpret cookie NAME=VALUEs. The only comment on character set in
the spec is that a cookie *comment* has to be utf-8 encoded.
I couldn't find anything on the MSDN documentation that addressed cookie
character sets either.
Anyone else run into this?
Thanks
_mark
I'm a little perplexed. <%@Codepage="65001" %> changes how IIS/ASP will
handle interpreting query string variables - i.e. it will read the
querystring as being utf-8 encoded.
However, I'm finding that it *doesn't* change how Response.Cookies or
Request.Cookies get read/written.
I've been testing with a little jscript asp page with the lines
if (String (Request.QueryString ("abc")) != "undefined")
Response.Cookies("abc") = Request.QueryString ("abc");
Response.Write (Request.QueryString ("abc"));
to take a value from the query string and pass it back out as a cookie. The
test value I was using was r%c3%a9sume (resume with an accented e). When the
code page is set to utf-8, it will properly interpret the urlencoded query as
a utf-8 string. It will output the right bytes with Response.Write.
But watching the headers produced by the request, it comes out encoded in
latin-1.
Set-Cookie: abc=r%E9sume; path=/
I checked the cookie rfc on w3c.org, and oddly it doesn't say much about how
to encode/interpret cookie NAME=VALUEs. The only comment on character set in
the spec is that a cookie *comment* has to be utf-8 encoded.
I couldn't find anything on the MSDN documentation that addressed cookie
character sets either.
Anyone else run into this?
Thanks
_mark