解决方案 »
- android 新浪微博 开发 认证 出错 老是无反应
- 100分求->如何在android手机上折线图,横轴为时间,纵轴为数字
- 如何在android源码中找到PackageManager类的具体实现
- 如何制作安装包,可以把程序用到的数据部分安装的SD卡上
- android bitmap内存溢出的问题!!!急急急!!!
- android新手 View的问题
- 在android系统上运行class文件,需要是安装什么,还是怎么弄,请高手指教!
- android中动态添加控件的问题
- 在静态Receiver类中不能调用非静态的finishActivity怎么办呢?
- 安卓Editext问题
- 问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