解决方案 »
- android如何与js交互
- 问个unbindService的问题
- Android Emulator 如何引入多个串口
- 【求助OPhone开发】web not available问题
- 动画对其它控件的 影响的问题
- 执行ifconfig配置ip后系统死机?
- 我的andriod 设备能做到这个吗
- 有谁知道httpresponse.addHeader和httpget.setHeader有什么不同吗
- 请问有没有可能将html5网页直接转成IOS/Android
- android 获取当前连接WIFI名称的问题
- 问Gallery配合BaseAdapter,其它一切正常,就是无法执行getView(...){...}
- 为什么SDKManager没有intel atom system image这一项
例如:下面代码假设读出来的source是GBK编码,尝试将其转换为UTF-8和GB2312编码,分别输出验证String source = readLine();
String utfDest = new String(sources.getBytes("GBK"), "UTF-8");
String gbDest = new String(sources.getBytes("GBK"), "GB2312");
System.out.println("UTFDest is " + utfDest);
System.out.println("GBDest is " + gbDest );
楼上的
String source = readLine();
String utfDest = new String(sources.getBytes("GBK"), "UTF-8");
是一个方法
也可以在用InputStream读取时指定编码为GBK
不过最好是把txt的编码改为utf-8