FormatCurrency在不同浏览器的不同页面上给出不同的结果?(FormatCurrency giving different results on different pages in dif

编程入门 行业动态 更新时间:2024-10-28 12:29:21
FormatCurrency在不同浏览器的不同页面上给出不同的结果?(FormatCurrency giving different results on different pages in different browsers?)

给出以下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),"£","&pound;") %></td>

要么

<td><%= Replace(FormatCurrency("123",2),"£","&#163;") %></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).

更多推荐

本文发布于:2023-07-28 18:38:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1307942.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:浏览器   页面   FormatCurrency   giving   browsers

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!