admin管理员组文章数量:1350092
I'm trying to display alert and confirm boxes with accents in them but when I run the application what I get are wrong characters, I checked the file encoding and it is UTF-8 and in the index.html I set the utf-8 charset.
Someone has any idea? Thanks.
I'm trying to display alert and confirm boxes with accents in them but when I run the application what I get are wrong characters, I checked the file encoding and it is UTF-8 and in the index.html I set the utf-8 charset.
Someone has any idea? Thanks.
Share Improve this question edited Aug 20, 2013 at 15:17 Reporter 3,9365 gold badges35 silver badges49 bronze badges asked Aug 20, 2013 at 15:03 xmarstonxmarston 8833 gold badges13 silver badges38 bronze badges1 Answer
Reset to default 9You can't use special characters in alert or confirm as they don't take special character directly,instead you can use \u escape sequence in the JavaScript string literal to display these characters.
alert("\u00e6\u00f8\u00e5")
to get output like this æøå
You can find utf-8 equivalent for character you want here
本文标签: javascriptWrong characters with accents in alerts and confirms with PhonegapCordovaStack Overflow
版权声明:本文标题:javascript - Wrong characters with accents in alerts and confirms with PhonegapCordova - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743870773a2553426.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论