[英]Which encoding should I use for my Android Studio project?
I had a problem similar to this one: Android Studio 1.2 - Project encoding mismatches by default 我遇到了类似这样的问题: Android Studio 1.2 - 默认情况下项目编码不匹配
The Android Studio project & gradle encoding is now set to windows-1252 instead of UTF-8. Android Studio项目和gradle编码现在设置为windows-1252而不是UTF-8。
Is there any reason I should be using one of these over the other? 有什么理由我应该使用其中一个而不是另一个?
Since gradle and Android studio both use UTF-8, you should consider using that. 由于gradle和Android studio都使用UTF-8,因此您应该考虑使用它。 It's a good encoding too as it's based on unicode charset.
它也是一个很好的编码,因为它基于unicode charset。
There has also been some talk on whether they should enforce UTF-8 or not in the future, so you should start changing to UTF-8 asap :) 还有一些关于他们是否应该在未来强制执行UTF-8的讨论,所以你应该开始更改为UTF-8尽快:)
You can change your encoding as follows below. 您可以按照以下方式更改编码。
Click File -> Settings (or click Ctrl + Alt + S) and find File Encodings in your Androd Studio. 单击文件 - >设置(或单击Ctrl + Alt + S),然后在Androd Studio中找到文件编码 。 See the image below as a reference.
请参阅下图作为参考。
Now you have three options 现在你有三个选择
http://shrani.si/f/3V/p7/5xt1uxV/encoding.png http://shrani.si/f/3V/p7/5xt1uxV/encoding.png
You can also see the current encoding of your file at the bottom right corner of Android studio. 您还可以在Android工作室的右下角看到文件的当前编码。 You can also change it there.
你也可以在那里改变它。 See the image below.
见下图。
Localization to numerous languages requires Unicode, so use UTF-8. 对多种语言的本地化需要Unicode,因此请使用UTF-8。
BTW, it is possible that due to this reasoning nobody never tested the development environment with a non-Unicode encoding. 顺便说一句,由于这个推理,有可能没有人从未使用非Unicode编码测试开发环境。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.