ASP.NET and UTF-8 problem

A

Andrei

Hi,
I have a simple html page with russian text and the encoding is UTF-8. I
have changed the extension of the page to aspx to add some code in the page
and i can't see the russian text. Also I've tried to add the directive <%@
CODEPAGE="65001" %> but there is no changes. How can I solve this problem?
 
J

Joerg Jooss

Andrei said:
Hi,
I have a simple html page with russian text and the encoding is
UTF-8. I have changed the extension of the page to aspx to add some
code in the page and i can't see the russian text. Also I've tried
to add the directive <%@ CODEPAGE="65001" %> but there is no
changes. How can I solve this problem?

It's not clear to me what CodePage really does. I guess it's just a hint
for the ASP.NET runtime how the actual .aspx file is encoded (similar to
the way encodings are decalred in XML), but I don't think it has any
effect on the actual output sent to the client. Have you set

<globalization
requestEncoding="utf-8"
responseEncoding="utf-8"
/>

in your web.config or do you use
Response.ContentEncoding = new System.Text.UTF8Encoding(); ?

Maybe the ASP.NET runtime reads the file correctly but applies another
encoding to the actual output stream.

And make sure your browser has encoding autodetection enabled ;-)

Cheers,
 

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

Forum statistics

Threads
473,780
Messages
2,569,611
Members
45,278
Latest member
BuzzDefenderpro

Latest Threads

Top