cookie codepage problem on iis 5.0

E

eyal.herlin

hi,

i set a cookie to hold a utf-8 string. either by the server or by the
client. it doesn't matter.
when i try to read this cookie using Request.Cookies("my_utf8_cookie")
on iis 5.0 i get garbage.
this garbage seems to be the result of treating the utf-8 data as some
single-byte encoding.
i have <%@ codepage="65001"%> set on the top of the page.
this problem does not appear on iis 5.1.
i have searched long and hard for a fix for this on news-groups and the
web but to no avail.
many people mention the problem but noone gives a proper fix.

i hope someone from MS sees this post and will put an end to this
issue.

thanks alot in advance,
Eyal Herlin
 
M

Mark Schupp

Are you telling the browser to use utf-8 also (in the HTML):

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

(I think you can do this with response.charset also)
 
A

Anthony Jones

Mark Schupp said:
Are you telling the browser to use utf-8 also (in the HTML):

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">

(I think you can do this with response.charset also)

That'll impact the content but the cookie headers are outside the content.

I'm not even sure how one would go about creating a UTF-8 encoded Cookie in
the first place.
 
E

eyal.herlin

hi anthony,

to create a utf-8 cookie on the client side u should have a utf-8 html
page that sets the cookie through javascript.
to create a utf-8 cookie on the server side u need to have the <%@
codepage="65001"%> decleration on top of your asp page.
 
E

eyal.herlin

hi mark,
yes i do.
my question has to do with how the server treats the cookie.
 
A

Anthony Jones

hi anthony,

to create a utf-8 cookie on the client side u should have a utf-8 html
page that sets the cookie through javascript.
to create a utf-8 cookie on the server side u need to have the <%@
codepage="65001"%> decleration on top of your asp page.

Using:-

Response.Cookies("test") = strContainsOutOfBandChars ??

In my testing characters outside of ASCII are removed when the codepage is
UTF-8.

What server are you using?
 
E

eyal.herlin

the problem i am having is on iis 5.0 on win2k.
it is my experience that Response.Cookies("test") =
strContainsOutOfBandChars
works fine. i assumed that by strContainsOutOfBandChars u mean a utf-8
string.
 
A

Anthony Jones

the problem i am having is on iis 5.0 on win2k.

That's the platform I'm testing on also.
it is my experience that Response.Cookies("test") =
strContainsOutOfBandChars
works fine. i assumed that by strContainsOutOfBandChars u mean a utf-8
string.

Yes my mistake I had forgotten to actually save my test file as UTF-8

I confirm it same behaves the same for me. Looks like a tweak on IIS5.1
(which works fine for me). I'll try IIS6 tomorrow.
 
A

Anthony Jones

Anthony Jones said:
That's the platform I'm testing on also.


Yes my mistake I had forgotten to actually save my test file as UTF-8

I confirm it same behaves the same for me. Looks like a tweak on IIS5.1
(which works fine for me). I'll try IIS6 tomorrow.


IIS 6 works fine also. Looks like an enhancement since 5.1.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top