How to configure UTF-8 in Android Studio?

4

This error appeared in Android Studio . Is there a setup to fix?

  

Error: (85, 69) error: unmappable character for encoding UTF-8

    
asked by anonymous 11.06.2015 / 23:04

1 answer

5

You can solve this problem in two ways:

  • convert the file to utf-8
  • put the correct type of encoding in your build.gradle script.
  • To convert the file, click the menu, below the right in your IDE. Select the correct type of encoding (type used authentically), then press "reload", select UTF-8 and press convert.

    For the second solution, put the correct encoding type in your build.gradle as follows:

    android {
        ...
        compileOptions.encoding = 'windows-1251' // coloque seu encoding atual aqui
        ...
    

    This blog the> is very interesting too. I recommend reading.

        
    12.06.2015 / 04:31