Android Studio messes up Brazilian Portuguese characters

My project does not display any Portuguese characters. When I try to enter the word "Não", it returns NÃ £ o ".

The funny thing is that when I get a string from res / string.xml, it correctly displays the word.

Any idea why?

Things I've tried so far have failed:

  • File -> Settings -> Editor -> File Encondings, I changed everything to UTF-8 and others, rebuilt / cleared the project and saved the same.

EDIT:

I can upload the video to youtube, showing it if this helps with the solution!

An image of what is happening appears: enter image description here

+4
source share
2 answers

My build.gradle file had the following line:

compileOptions.encoding = 'ISO-8859-1'

- . .:)

+1

, , , . , , Genymotion, ... , , , Android , Resources, String . , , English. , . 100%, , doc.

, String TextView ( ) 2 :

1) .ttf /Unicode 2) html

:

String s="(Mouy t'ngai) (១ ថ្ងៃ)";
TextView text_view1 = null;
text_view1 = (TextView) findViewById(R.id.textView2);
Typeface font= Typeface.createFromAsset(getAssets(), "khmerOS.ttf");
text_view1.setTypeface(font);
text_view1.setText(s);

// you can use different type of .ttf like
TAU_BHON.TTF
molten.ttf
arialuni.ttf

:

tv.setText(Html.fromHtml("\\u27A1"); 

.

P.S. - , , , .

0

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


All Articles