What encoding should I use for my Android Studio project?

I had a problem like this: Android Studio 1.2 - default project encoding mismatch

Android Studio project and gradle encoding are now set to Windows-1252 instead of UTF-8.

Is there some reason why I should be using one over the other?

+4


source to share


2 answers


Since Gradle and Android Studio both use UTF-8, you should consider this. It is also a good encoding as it is based on the Unicode encoding.

There has also been some talk about whether they should use UTF-8 or not in the future, so you should start migrating to UTF-8 as soon as possible :)

You can change the encoding as follows.

Click File -> Preferences (or press Ctrl + Alt + S) and search for file encodings in Androd Studio. See the image below for reference.



You now have three options

  • change UTF-8 to match different encoding
  • or change the encoding of the project to match UTF-8, as both Gradle and Android Lint use this (recommended)
  • Ignore the warning

enter image description here
(source: shrani.si )

You can also see the current encoding of your file in the bottom right corner of Android studio. You can also change this there. See the image below.

IDE Encoding

+6


source


Localization into many languages ​​requires Unicode, so use UTF-8.



By the way, it is possible that due to this reasoning, no one has ever tested a development environment with a non-Unicode encoding.

+1


source







All Articles