给出以下VBscript代码: FormatCurrency("123",2) 写到HTML页面: <td><%= FormatCurrency("123",2) %></td>
两个页面都具有相同的字符集“ISO-8859-1”,并且与字符集“UTF-8”显示相同的行为。
我在浏览器中得到了几个结果 - IE10和FireFox38显示如下: “付款页面”:£123.00 “收据页”:£123.00
在Chrome45中我收到: “付款页面”: 123.00 “收据页”:£123.00
我一直在盯着这个问题一小时,我不知道为什么会出现这个问题。
Given the following VBscript code: FormatCurrency("123",2) written to an html page: <td><%= FormatCurrency("123",2) %></td>
Both pages have the same charset "ISO-8859-1", and show the same behavior with charset "UTF-8".
I am getting several results across browsers - IE10 and FireFox38 display the following: "Payment Page": £123.00 "Receipt Page": £123.00
while in Chrome45 I receive: "Payment Page": �123.00 "Receipt Page": £123.00
I've been staring at this problem for the better part of an hour, and I have no idea why this issue is occurring.
最满意答案
Mojibake : £是ANSI解释UTF-8编码的£ (十六进制0xC2 0xA3 )。 下一个解决方法可以帮助:
<td><%= Replace(FormatCurrency("123",2),"£","£") %></td>要么
<td><%= Replace(FormatCurrency("123",2),"£","£") %></td>见http://www.w3schools.com/html/html_entities.asp
A cow-orker pointed this out to me, after having a similar issue:
Make sure your file is saved in the proper encoding! My file was saved in UTF-8 and needed to be encoded in ANSI (it's an old system).
更多推荐
发布评论