0

I have an array of strings which are in latin and have some letters which are turned into "?", I need them to display correctly.

String[] asd= {"Srećni nikad ne razmišljaju o sreći."};

in "asd" I have strings which I need to display correctly in TextView on my android device, but every "ć", "š" turns into "?".

textView.setText(asd[0]);

I am using Android Studio. Thanks

luk492
  • 350
  • 3
  • 15

3 Answers3

2

In Android Studio there is two options for encoding you need to check

1- your project encoding
2- your IDE encoding
you will find them under setting
enter image description here


Please make sure also not to hard code any strings you have to put them in string xml files

Mohamed
  • 761
  • 9
  • 19
0

Try using Unicode, here is a table for your convenience ; http://unicode-table.com/en/#00E8

And chech this question, it may help;

Unicode characters not displayed in TextView.setText

Community
  • 1
  • 1
Ashtaroth
  • 47
  • 10
0

You are supposed to put strings like that into your XML and get them from there. It's a good idea too, since that allows you to have several languages, yet using the same code. Read more here

Bojan Kseneman
  • 15,488
  • 2
  • 54
  • 59