惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

大猫的无限游戏
大猫的无限游戏
Webroot Blog
Webroot Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
T
Threat Research - Cisco Blogs
V2EX - 技术
V2EX - 技术
L
LINUX DO - 热门话题
Google DeepMind News
Google DeepMind News
Recorded Future
Recorded Future
S
Schneier on Security
I
InfoQ
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
The GitHub Blog
The GitHub Blog
S
Security @ Cisco Blogs
O
OpenAI News
W
WeLiveSecurity
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
Simon Willison's Weblog
Simon Willison's Weblog
人人都是产品经理
人人都是产品经理
Cloudbric
Cloudbric
The Last Watchdog
The Last Watchdog
The Hacker News
The Hacker News
Google Online Security Blog
Google Online Security Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
NISL@THU
NISL@THU
T
Tailwind CSS Blog
V
Visual Studio Blog
PCI Perspectives
PCI Perspectives
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Jina AI
Jina AI
D
DataBreaches.Net
B
Blog RSS Feed
N
News and Events Feed by Topic
N
News and Events Feed by Topic
H
Heimdal Security Blog
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
腾讯CDC
Latest news
Latest news
V
Vulnerabilities – Threatpost
Hacker News: Ask HN
Hacker News: Ask HN
WordPress大学
WordPress大学
V
V2EX
aimingoo的专栏
aimingoo的专栏
博客园 - 司徒正美
Apple Machine Learning Research
Apple Machine Learning Research
D
Darknet – Hacking Tools, Hacker News & Cyber Security
The Register - Security
The Register - Security
Help Net Security
Help Net Security

博客园 - Kenny田

iOS 下 Podfile 使用方法 使用 NVM 管理不同的 Node.js 版本 将React Native集成至Android原生应用 Gradle在Windows环境与Linux上配置有哪些不同? 学习Android Studio里的Gradle 不知道如何处理的Windows Phone异常 用命令行安装并启动Windows Phone 8 App 在Windows Phone项目中调用C语言DLL 演示Microsoft Advertising SDK for Windows Phone 8.1 PLSQL Developer 初始化错误 [原]初次运用数据缓存机制 [原]执行存储过程后返回影响的行数 [原]可定义的英文小日历 可逆加密解密程序(ASP版) [原]有TreeNode”并不包含“Nodes”的定义困扰的朋友看过来 全文服务(Microsoft 搜索)不可用。系统管理员必须启动此服务 [转]解决sql2000挂起无法安装的问题 [转]安装SQL Server 2000 时出现 command line option syntax error [原]如何将一个表中的某一列的数据全部复制到另一个表中
解决 Android Studio 乱码问题
Kenny田 · 2015-04-23 · via 博客园 - Kenny田

Android Studio中的乱码分好几种,一是IDE的不同窗口里显示乱码,如:logcat筛选框,SVN提交的注释框。二是代码里设置中文,到了真机UI上就显示的乱码,如:xxx.setText("中文")。

一、IDE乱码

Log Level 右边的过滤框明明输入的是中文,结果显示是乱码。

File > Settings > Appearance & Behavior > Appearance,将default fonts改为Microsoft YaHei(改成其它SimHei,SimSun也行,但个人觉得雅黑好看些)。

设置好了之后,立即就能看到筛选框里的中文字符了。

二、代码里中文

代码里设置中文,到了真机上TextView之类的控件上就显示为乱码,如:xxx.setText("中文")。

我现在加入的这个项目是由原来Eclipse创建的,一旦有乱码问题,同事就说把Properties里的编码改成GBK就可以了。

先不论他的对错,但他这么一改确实就不会乱码了,但由于我用的是Android Studio,那我该怎么办呢?

File > Settings > Editor > File Encodings 里Project Encoding改为UTF-8,为了统一规范,我也将其它Encoding项也设置为UTF-8了。

三、Gradle 乱码

最后,如果有朋友遇到Gradle提示中文乱码的问题,可以参考http://blog.csdn.net/sljjyy/article/details/11976099,我目前没有遇到过。