Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

The Android Studio project & gradle encoding is now set to windows-1252 instead of UTF-8.

Is there any reason I should be using one of these over the other?

like image 387
Leperkawn Avatar asked Mar 17 '23 03:03

Leperkawn


1 Answers

Since gradle and Android studio both use UTF-8, you should consider using that. It's a good encoding too as it's based on 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 :)

You can change your encoding as follows below.

Click File -> Settings (or click Ctrl + Alt + S) and find File Encodings in your Androd Studio. See the image below as a reference.

Now you have three options

  • change UTF-8 to match other encoding
  • or change project encoding to match UTF-8 since 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 at the bottom right corner of Android studio. You can also change it there. See the image below.

IDE Encoding

like image 135
Bojan Kseneman Avatar answered Mar 21 '23 15:03

Bojan Kseneman