Special charcters in Android using PhoneGap

不打扰是莪最后的温柔 提交于 2019-12-11 16:39:55

问题


Im using PhoneGap to develop an android application. The problem is characters like ã â á ç are shown like ? (question mark) Has someone an idea to solve the problem? Thanks


回答1:


You need to use the UTF-8 character set on your page. You can tell the browser to do so by adding this:

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 

... to the <head> section of your page.




回答2:


In my Phonegap & jQueryMobile app, deployed on Android 4.0.3 device, I got a nastly little bit of this stuff showing up in my checkboxes:

â€,

That was the little critter in my case. I did not get any success with

<meta name="viewport" content="width=device-width, initial-scale=1, charset=utf-8">

But what did work was setting the charset as a direct attribute of the meta tag:

<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">

So it's worth your while experimenting exactly how to specify the charset.




回答3:


Do you use Eclipse? If so, I believe here is what you are looking for:

UTF-8 unreadable in phonegap android

(Project - Properties - Resource: Text File Encoding - Other [UTF-8]).



来源:https://stackoverflow.com/questions/4798472/special-charcters-in-android-using-phonegap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!