Spanish characters in Android Studio

I have a problem with Android Estudio, I'm trying to develop an application, but characters like "¿" or "ñ" and "á, é, ó, í, ú" do not display correctly. I started the application. I tried to solve the problem of changing the encoding to UTF-8, but it does not matter. Can someone help me? Thanks

+7
source share
4 answers

You can solve this problem with Unicode characters:

http://javawiki.sowas.com/doku.php?id=java:unicode

Just replace the number with the character you need:

http://unicode-table.com/de/#0115

For instance:

¿ = \u00BF ñ = \u0148 á = \u0227 é = \u00E9 

Hope this is what you need;)

+5
source

Instead of replacing each accent with a Unicode character to match the setup of the UTF-8 project, just add this line to the module application assembly class in the android node:

android {

 compileOptions.encoding "ISO-8859-1" // For Spanish [Otherwise strange accents] 

Then you do not need to modify any existing data that you wrote, and you can save these strange Spanish characters!

+4
source

Hi i got a solution

String strJunk = "Atrà © vete a Soà ± ar";

byte [] arrByteForSpanish = strJunk.getBytes ("ISO-8859-1");

String strSpanish = new String (arrByteForSpanish);

I did this and now I am using Spanish characters correctly instead of unwanted characters.

+2
source

in bild.gradle (application model) use this configuration:

 android { compileOptions.encoding = 'ISO-8859-1' // write your encoding here compileSdkVersion 25... 
0
source

Source: https://habr.com/ru/post/1489908/


All Articles