¿Cómo puedo usar caracteres turcos como 'ş ç ı ö' en un TextView de Android?

I want to write 'ile' in android TextView but it isn't drawn correctly. How can use characters like this?

For example I set the my textview as 'çile' it shows as '?ile' instead; how can I fix this?

preguntado el 30 de enero de 12 a las 19:01

Have you checked the font being used includes these characters? -

it is not support some porteguse ,spanish ,italian characters too. -

3 Respuestas

Try the following and see if it helps (fuente):

String description = "Turkish characters here";
TextView tv = (TextView) findViewById(R.id.description); 
tv.setText(Html.fromHtml(description).toString());

Respondido el 30 de enero de 12 a las 23:01

it is not recognize the html tag - Ersin Gülbahar

@ersyn61 What html tag are you referring to? - Marvin Pinto

I use your code and ımport html but same issue. turkish charackters doesnt seen - Ersin Gülbahar

it is not support some porteguse ,spanish ,italian characters too. - Ersin Gülbahar

This to me screams: character-encoding issue. A lot of software (eg browsers, database clients) robustly handle unexpected bytes by replacing them with question marks. But Turkish characters are supported by "UTF-8", Android's default charset.

http://developer.android.com/reference/java/nio/charset/Charset.html#defaultCharset%28%29

You may want to start by checking that your charset is indeed set to UTF-8/16 or ISO-8859-9 (Turkish). If that isn't the problem, it could be the font itself.

If that still doesn't solve the problem, I would post a small example of the code you are using to display the text. From file to database to database connection to web browser, there are many places where conversion can happen.

Respondido el 31 de enero de 12 a las 00:01

I want to my textview support all language characters? what can ı do - Ersin Gülbahar

Please post a small example of your code and where you are seeing the issue. UTF8 encoding supports foreign language characters. - Brian Duncan

in my manifest : <?xml version="1.0" encoding="utf-8"?> but when ı want to use spanish or turkish characters in textview dont seem - Ersin Gülbahar

getinput.settex("grávida"); this is seems like this : gr?vida - Ersin Gülbahar

it is not support some porteguse ,spanish ,italian characters too. - Ersin Gülbahar

This answer solved my problems for turkish characters.

https://stackoverflow.com/a/9312031/218198

contestado el 23 de mayo de 17 a las 14:05

This simple solution did not worked for SDK's 2.3 and 3.2 for me. To cover 2.3, 3.2 and 4.0 I added some more lines: String htmlData = "Html data with tags and turkish characters"; String header = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"; webView.loadData(header+htmlData, "text/html;charset=UTF-8", null); - milkersarac

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.