本文介绍了如何显示的Latin-1在Android应用程序字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我必须从在线数据库连接codeD的Latin-1的字符集和每一个特殊的拉丁字符(即A,O,U,è...)被显示为黑色方块用?获取文本里面。

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 "?" inside.

我怎样才能显示这是否正确?

How can i display this correctly?

幸运的是,我发现后几个小时一个答案,我想与大家分享。下面请阅读我的解决方案

Luckily i found an answer after a couple of hours and i want to share it with you all.Read below for my solution

推荐答案

解决方案是非常简单的,但我还没有想过这个问题,但它有被非常简单的理解和实现的利益。事实上,这里是code:

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"));

这样,从拉丁1服务器的所有传入的字符串将正确地去codeD,将在Android TextViews完美显示

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

这篇关于如何显示的Latin-1在Android应用程序字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-21 02:15