i want to display some non english characters in a textbox.
i am trying with
$("#txtSearch").val('<%:Html.Raw(ViewBag.my_search)%>')
It should display '2100 - København Ø' but it is displaying '2100 - København Ø'.
my controller reading this value from cookie and assigning it in a ViewBag. In the controller i have
ViewBag.my_search = cookie.Value
// here it is assigning the right danish word but when it displays inside the input box, it just displays wrong.
any idea how to solve this??
EDIT:
Well, it is working good in my local pc, but when I host it into some remote hosting provider, it does not perform good.
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
is not a good way to set your page's encoding because it is overriden by the real http header. So if the remote hosting provider is sending a content-type header, it will be ignored.Your data is correctly utf-8, so that's good. All you need do is set the content-type http header, so that the browser will read it as utf-8 and not windows-1252.
You can set your individual page to send the header with:
Or you can set it in Web.config globally: