android txt英文与繁体中文中空格和回车消失
英文我用 UTF-8 无乱码
繁体我用 GB2312—80
但他在textview中的空格和回车消失了
public class ReadUncodeActivity extends Activity {
private TextView txt;// 文本
// UTF-8,GBK,GB2312;
public static final String ENCODING = "UTF8";// 英文
public static final String ENCODING1 = "GB2312";// 大陆简体中文
public static final String ENCODING2 = "GB2312—80";// 台湾繁体中文 @Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

txt = (TextView) findViewById(R.id.Read_textView); // 读assets中的文件
String msg = getResources().getString(
R.string.lomowall_feed_setting_panduan);
txt.setText(getFromAssets(msg));
} // 从assets 文件夹中获取文件并读取数据
public String getFromAssets(String fileName) {
String result = "";
try {
InputStream in = getResources().getAssets().open(fileName);
// 获取文件的字节数
int lenght = in.available();
// 创建byte数组
byte[] buffer = new byte[lenght];
// 将文件中的数据读到byte数组中
in.read(buffer);
String code = getResources().getString(R.string.lomowall_feed_setting_txtcode);
if(code.equals(ENCODING2)){
result = EncodingUtils.getString(buffer, ENCODING2);
}else if(code.equals(ENCODING1)){
result = EncodingUtils.getString(buffer, ENCODING1);
}else 
result = EncodingUtils.getString(buffer, ENCODING);
} catch (Exception e) {
e.printStackTrace();
}
return result;
}}