开发者

Problem with extended ASCII characters in web page/master page

I have some localization problems in my webpage.

There are basically two problems (that I suspect have a different sulution, but they are conseptually linked)

First problem is this:

I have a website that is using a master page. All text from the page is fine, but all text that comes from the master page file, get scrambled norwegian characters. For example Ø shows up as Ø. It seems that all characthers in the extended ASCII table gets scrambled this way. Afterwards, if I open the master page in Notepad the Ø looks normal, but if I remove the Ø and write a new Ø manually, then save the file from Notepad, and then open the website in the browser, it looks fine and the Ø is shown properly. So it seems that Visual Studio saves the characters wrongly in the master file, but correct for the aspx file.

Any clue here?

The second issue is norwegian characters coming from jQuery. All of these characters get's replaced by a questionmark with a black box around it. Here, modifyi开发者_如何学Gong the js file in Notepad does not help, and it still display scrambled in the browser.

Any input here would be appreciated.


Try putting this in your web.config:

<system.web>
    <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>

Also make sure that all your pages are saved as UTF-8 with signature: open each aspx file individually in your project and click File -> Save As -> Save with Encoding....

Also indicate the encoding in the head section of each page:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜