jQuery autoNumeric 插件用问号替换欧元符号
jQuery autoNumeric plugin replace euro sign with question mark
我正在使用 autoNumeric,一个自动格式化货币的 jQuery 插件。
一切正常,但欧元符号 (€) 被问号 (�) 取代。
我已经阅读 this and this,但这似乎不是编码问题,因为我在页面上使用了以下元标记:
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
还用 html 友好的 €
代码替换了外来字符,但没有解决问题,它只是在字段 input[= 中显示 € 123,00
18=]
$('#import').autoNumeric('init', {
aSep: '.',
aDec: ',',
vMin: '-999999999.99',
vMax: '999999999.99',
aSign: '€' // also tried with '€'
});
如果我用美元符号 (aSign: '$'
) 替换欧元符号,它工作正常!
提前致谢
问题可能是由于字符编码不匹配(Refer)
为 €
使用 unicode 值。
aSign : '\u20AC'
$('#import').autoNumeric('init', {
aSep: '.',
aDec: ',',
vMin: '-999999999.99',
vMax: '999999999.99',
aSign : '\u20AC'
});
我正在使用 autoNumeric,一个自动格式化货币的 jQuery 插件。 一切正常,但欧元符号 (€) 被问号 (�) 取代。
我已经阅读 this and this,但这似乎不是编码问题,因为我在页面上使用了以下元标记:
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
还用 html 友好的 €
代码替换了外来字符,但没有解决问题,它只是在字段 input[= 中显示 € 123,00
18=]
$('#import').autoNumeric('init', {
aSep: '.',
aDec: ',',
vMin: '-999999999.99',
vMax: '999999999.99',
aSign: '€' // also tried with '€'
});
如果我用美元符号 (aSign: '$'
) 替换欧元符号,它工作正常!
提前致谢
问题可能是由于字符编码不匹配(Refer)
为 €
使用 unicode 值。
aSign : '\u20AC'
$('#import').autoNumeric('init', {
aSep: '.',
aDec: ',',
vMin: '-999999999.99',
vMax: '999999999.99',
aSign : '\u20AC'
});