Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrong characters with accents in alerts and confirms with Phonegap/Cordova

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.

like image 860
xmarston Avatar asked Aug 20 '13 15:08

xmarston


1 Answers

You 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

like image 169
L10 Avatar answered Nov 09 '22 22:11

L10