UTF-8编码在Internet Explorer中不能正常工作,但是在Mozilla Firefox中可以很好地工作

时间:2023-01-06 21:46:52

I need to display an alert box in other than English language for which I am making use of bean message using Application Resource properties file. The code written in JSP works perfect in Firefox but in IE the characters are messed up and I get all box signs inside alert box.The same problem occurs for ToolTips as well. Any solutions?

我需要用英语以外的语言显示警报框,我正在使用应用程序资源属性文件来使用bean消息。用JSP编写的代码在Firefox中工作得很好,但是在IE中,字符被搞砸了,我在警报框中得到了所有的框号。工具提示也会出现同样的问题。有解决方案吗?

2 个解决方案

#1


8  

Check your page encodings

检查你页面编码

FF uses UTF-8 page Encoding. View--> Character Encodings

FF使用UTF-8页面编码。视图- - >字符编码

Earlier versions of IE set character encoding according to the language on the client when the document did not specify encoding

当文档没有指定编码时,早期版本的IE根据客户机上的语言设置字符编码

Which IE Version are you using ?

你使用哪个IE版本?

This may help also. IE uses the wrong character set when it renders an HTML page

这也可以帮助。IE在呈现HTML页面时使用了错误的字符集

Is charset is utf in headers ?

字符集是标头中的utf吗?

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

#2


2  

I did found a solution for my query. Actually the issues were with the tool tips and alert boxes were getting displayed in box sign characters only in Internet Explorer and that too in Windows Xp but working properly in windows 7 and other browsers. What i did was:

我确实为我的查询找到了一个解决方案。实际上,问题在于工具提示和警告框只在Internet Explorer和Windows Xp中显示,但在Windows 7和其他浏览器中正常工作。我所做的是:

1. Right Click On Desktop
2. Properties
3. Appearence Tab
4. Click On Advanced Button
5. In the Item Combo box Select MessageBox(the font combo box should get enabled by then)
6. Select Arial MS Unicode Font instead of Tahoma(Windows XP Default) Font.

And then Check. The desired output will be seen. This is a work around solution but it seems to work fine. Thanks WouterH and Hardik for your guidance till here.

然后检查。期望的输出将被看到。这是一个围绕解决方案的工作,但它似乎工作得很好。感谢WouterH和Hardik的指导,直到这里。

#1


8  

Check your page encodings

检查你页面编码

FF uses UTF-8 page Encoding. View--> Character Encodings

FF使用UTF-8页面编码。视图- - >字符编码

Earlier versions of IE set character encoding according to the language on the client when the document did not specify encoding

当文档没有指定编码时,早期版本的IE根据客户机上的语言设置字符编码

Which IE Version are you using ?

你使用哪个IE版本?

This may help also. IE uses the wrong character set when it renders an HTML page

这也可以帮助。IE在呈现HTML页面时使用了错误的字符集

Is charset is utf in headers ?

字符集是标头中的utf吗?

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

#2


2  

I did found a solution for my query. Actually the issues were with the tool tips and alert boxes were getting displayed in box sign characters only in Internet Explorer and that too in Windows Xp but working properly in windows 7 and other browsers. What i did was:

我确实为我的查询找到了一个解决方案。实际上,问题在于工具提示和警告框只在Internet Explorer和Windows Xp中显示,但在Windows 7和其他浏览器中正常工作。我所做的是:

1. Right Click On Desktop
2. Properties
3. Appearence Tab
4. Click On Advanced Button
5. In the Item Combo box Select MessageBox(the font combo box should get enabled by then)
6. Select Arial MS Unicode Font instead of Tahoma(Windows XP Default) Font.

And then Check. The desired output will be seen. This is a work around solution but it seems to work fine. Thanks WouterH and Hardik for your guidance till here.

然后检查。期望的输出将被看到。这是一个围绕解决方案的工作,但它似乎工作得很好。感谢WouterH和Hardik的指导,直到这里。