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

2019-03-17 09:41发布

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?

3条回答
放荡不羁爱自由
2楼-- · 2019-03-17 10:03

This answer solved my problems for turkish characters.

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

查看更多
霸刀☆藐视天下
3楼-- · 2019-03-17 10:21

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());
查看更多
Lonely孤独者°
4楼-- · 2019-03-17 10:21

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.

查看更多
登录 后发表回答