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

推荐订阅源

P
Privacy & Cybersecurity Law Blog
Engineering at Meta
Engineering at Meta
Forbes - Security
Forbes - Security
MongoDB | Blog
MongoDB | Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
A
About on SuperTechFans
量子位
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
雷峰网
雷峰网
腾讯CDC
P
Proofpoint News Feed
S
Schneier on Security
S
Secure Thoughts
V
Visual Studio Blog
Help Net Security
Help Net Security
The Hacker News
The Hacker News
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Privacy International News Feed
SecWiki News
SecWiki News
S
SegmentFault 最新的问题
T
Threatpost
小众软件
小众软件
MyScale Blog
MyScale Blog
F
Fortinet All Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
T
Tailwind CSS Blog
I
Intezer
C
CERT Recently Published Vulnerability Notes
U
Unit 42
V
V2EX
Cyberwarzone
Cyberwarzone
Recorded Future
Recorded Future
O
OpenAI News
Project Zero
Project Zero
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
Hugging Face - Blog
Hugging Face - Blog
Know Your Adversary
Know Your Adversary
C
Cybersecurity and Infrastructure Security Agency CISA
Scott Helme
Scott Helme
V2EX - 技术
V2EX - 技术
博客园 - 叶小钗
S
Securelist
A
Arctic Wolf
The Cloudflare Blog
W
WeLiveSecurity
T
Threat Research - Cisco Blogs
博客园 - Franky

博客园 - 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,我目前没有遇到过。