asp.net text messed issue

89 Views Asked by At

First of all take a look at website www.elcieloessalud.com/Tratamientos.aspx

I have built this website for a spanish client of mine, it is built in .net framework 3.5
issue is that i have a cms kind of page that allows me to change text of the pages etc.
when changed, text appears perfect in rich text box but page appears messed up. as you can see in the above page lots of aquí,Salvación ,Dios…†etc..
although it should be something like aquí,Salvación,Dios…”

Any help in this help would be appreciated!

Regards,

Umair

2

There are 2 best solutions below

2
On

Include this on your html header part

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

If you page is not on utf-8, then I suggest to render it on utf-8, or find your charset for your Language and set it. The charset must be the same as your file to have correct render. In the visual studio you can see your char set of your file on the menu: File | Advanced Save Options... In some friends of me this menu is not exist, you can add it on the Tools | Customize. (for more details for how to add it search on internet - there are a lot of info.)

Also you can try to set on web-config (or set your language)

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

Finally i did it :) with help of @Aristos as well!

we need to include

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

in all the pages including masterpage and change charset of language to whatever yours is and when creating the streamwriter to write we need to indicate the encoding there as well as below
Dim sw As StreamWriter
sw = New StreamWriter(FileName, False, Encoding.UTF8)



and you are done !! :) happy coding