String text;
byte[] b1 = text.getBytes("ISO8859-1");
text = new String(b1, "GB2312");
byte[] b1 = text.getBytes("ISO8859-1");
text = new String(b1, "GB2312");
解决方案 »
- 求java中CLASSNOTFOUNDEXCEPTION解决办法
- 模拟 JDK Map 集合
- Class的getResourceAsStream(String name), name对应的路径为什么需要在前面加/
- 高分求助,请问用jfreeChart画图,可以在一个图上同时画柱状图和折线图吗?
- java怎么打开FTP服务器上的文件?
- 无法打印出JTable的第一行表头
- 如何将java程序生成应用程序
- 在RandomAccessFile中如何写入中文?
- 关于SUBSTRING 问题
- 小问题:ArrayList的作用?怎么用?简例说明
- 高难问题:applet里面如何取得session?因为要对applet的操作进行控制
- 重载问题?
String s = new String(byte[] b);
String(byte[] bytes, int offset, int length, String charsetName)
Constructs a new String by decoding the specified subarray of bytes using the specified charset.
String(byte[] bytes, String charsetName)
Constructs a new String by decoding
public String(String str);
public String(StringBuffer buffer);
public String(char ch[]);
public String(byte b[]);
if (a == null)
return "null";
if (a.length == 0)
return "[]";
StringBuilder buf = new StringBuilder();
buf.append('[');
buf.append(a[0]);
for (int i = 1; i < a.length; i++) {
buf.append(", ");
buf.append(a[i]);
}
buf.append("]");
return buf.toString();
}