How to display Latin-1 characters in Android app

后端 未结 1 1505
执笔经年
执笔经年 2021-01-19 10:53

I have to fetch text from an online database encoded in Latin-1 charset and every special Latin character (i.e. à, ò, ù, è...) was displayed with black squares with a \"?\"

相关标签:
1条回答
  • 2021-01-19 11:29

    solution was really simple but i haven't thought about it, but it has the benefit of being really simple to understand and implement. In fact, here is the code:

    mIn = new BufferedReader(new InputStreamReader(mSocket.getInputStream(),"ISO-8859-1"));
    

    this way, all the incoming strings from the Latin-1 server will be decoded correctly and will be displayed perfectly on android TextViews

    0 讨论(0)
提交回复
热议问题