How can I use Turkish characters like 'ş ç ı ö

2019-03-17 09:30发布

问题:

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?

回答1:

This answer solved my problems for turkish characters.

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



回答2:

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

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


回答3:

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.