How can I use Turkish characters like 'ş ç ı ö' in an Android TextView?

前端 未结 3 1753
太阳男子
太阳男子 2021-02-06 18:03

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 \'

3条回答
  •  闹比i
    闹比i (楼主)
    2021-02-06 18:30

    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.

提交回复
热议问题