显示葡萄牙语字符的Andr​​oid [英] Displaying portuguese characters Android

查看:231
本文介绍了显示葡萄牙语字符的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个Android应用程序,当它被suposed写出像NAO或cabeça,字与字〜或C为例,它写道:à£或§ 。我已经选中的源文件编码,它是UTF-8。

I'm developing an Android app and when it was suposed to write words like "não" or "cabeça", with characters with "~" or "ç" for example, it writes "ã" or "ç". I already checked source files encoding and it is UTF-8.

推荐答案

看起来PTED为ISO-8859-X UTF8跨$ P $。

Looks like UTF8 interpreted as ISO-8859-x.

在理论上,你可以提供的javac编译 -encoding 在命令行中的UTF-8,但是这将是错误的解决方案。

In theory, you could supply the javac compiler -encoding UTF-8 on the command line but that would be the wrong solution.

相反,将所有用户面对的字符串到一个XML资源文件。在有单向code字符编码工作开箱。

Instead, move all your user-facing strings to an XML resource file. In there unicode character encoding works out of the box.

延伸阅读: http://developer.android.com/guide /topics/resources/string-resource.html

这篇关于显示葡萄牙语字符的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆