unicode characters in web form aspx pages, utf-8

R

ray well

hi,

i need to include some non english text in some web from aspx pages, in
which i used unicode characters and saved them with unicode encoding
(without signature).

in regular html only pages i add the following line to the <head> section to
make the text show up properly, otherwise it shows up as garbage.

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

when i do this in aspx page, the unicode text still shows up as garbage.

how can i make the unicode show properly?

please include a snipett of sample.

thanks

ray
 
J

Joerg Jooss

ray said:
hi,

i need to include some non english text in some web from aspx pages,
in which i used unicode characters and saved them with unicode
encoding (without signature).

in regular html only pages i add the following line to the <head>
section to make the text show up properly, otherwise it shows up as
garbage.

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

when i do this in aspx page, the unicode text still shows up as
garbage.

how can i make the unicode show properly?

META tags are just a last resort, and they are plain useless if the
page's encoding isn't the supposed encoding.

Are you really using UTF-8 as response encoding and is your browser
configured to pick up the encoding automatically?

Cheers,
 
R

ray well

i'm not using the unicode in response code, but in labels indentifying areas
on the page (which shows up as garbage. my browser can read the encoding in
regular html pages, so it is configured to read the encoding.

ray
 
J

Juan T. Llibre

If you are using characters in the range 128-255,
you need to use iso-8859-1 as your encoding, and not utf-8.



Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
 
J

Juan T. Llibre

Have you set the encoding settings in web.config ?

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



Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
 
R

ray well

Juan,

thanks for

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

i was missing fileEncoding="utf-8", i had the other 2, when i added this it
started working.

thanks again

ray
 
J

Juan T. Llibre

"It's the little things that getcha."
-unknown philosopher

Glad it's working now!



Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
 

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

Top