3

I'm using Android Studio 1.2, when I create a project, then I open the File Encodings setting window via File -> Settings -> Editor -> File Encodings, there is the Project Encoding option which defaults to GBK on my computer (Windows 7 64 bit). I could manually change it to UTF-8 for each project, but is there a way to let it default to UTF-8 directly?

Thanks in advance.

CrazyOrr
  • 307
  • 2
  • 3
  • 13

2 Answers2

8

Please have a try, it works for me. File -> Other Settings -> Default Settings, then find "File Encodings", change Project Encoding to UTF-8.

2

Go through File -> Settings -> File Encodings in your Android Studio. See the attached screenshots.

Here, you have 4 options

  1. Change project encoding to match UTF-8. enter image description here
  2. Change IDE encoding to match other encoding. enter image description here
  3. Change Default encoding for properties files. enter image description here
  4. See the current encoding of your file at the bottom right corner of Android studio. You can also change it there. enter image description here

It will be helpful to you!!

Garima Mathur
  • 3,312
  • 3
  • 18
  • 32
  • Thanks for your answer, but the thing is I want to change the initial project encoding when I create a project (i.e., the default value of project encoding), which is `GBK` for now, and I want it to be `UTF-8`. To put it shortly, I ask this question to find a way to avoid going through the steps as you mentioned. – CrazyOrr May 20 '15 at 05:50
  • Android Studio configuration provides system default encoding as default if you want to UTF-8 then you have to change it manually for single project. – Garima Mathur May 20 '15 at 07:27
  • This is quite old question, but I am facing a strange problem. I have encoding problems but only in a library project. For example, if in a library project I assign "Código inválido" and I watch that variable, this is shown: "Código inválido". If I do that in the activity code, the variable is shown correctly. What's wrong with this? – jstuardo Aug 26 '20 at 18:53