急啊急,使用什么方法可以得到一个汉字的Unicode编码? MultiByteToWidecharWidecharToMultiByte 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 bwsabc(javavaj) 你的方法好像不行吧?请明示 为什么我打印出来的是 负数 呢?程序如下:byte[] b = "王".getBytes();for(int i = 0 ; i < b.length ; i++){ System.out.println(" " + b[i]);}结果如下: -51 -11 String s = "汉字"; System.out.println("\\u" + Integer.toHexString(s.charAt(0)) +"\\u"+Integer.toHexString(s.charAt(1))); System.out.println("\u6c49\u5b57"); String str = "王"; try { byte[] by = str.getBytes("GBK"); int i = by[0]; i=i<<8; i+=by[1]; System.out.println(Integer.toHexString(i)); } catch(Exception e) { e.printStackTrace(); } System.out.println(Integer.toHexString("王".charAt(0))); Object为什么不设计为抽象的 空字符串 今天的笔试题 请问,如何画仪表盘(要能够修改表针的粗细)?谢谢 Socket如果何通过http代理访问internet 初学Java的新手,虚心请教一些问题.望高手回复.谢谢! SWT开发中,如何设置组件背景是透明的? 请问谁有J2ME的模拟器的下载地址。 如何通过java调用sybase的存储过程? 师傅们帮我看看这段代码?谢谢了 服务线程停止后如何释放占用的端口 关于特殊字符的替换问题
请明示
for(int i = 0 ; i < b.length ; i++){
System.out.println(" " + b[i]);
}结果如下: -51
-11
System.out.println("\\u" + Integer.toHexString(s.charAt(0)) +"\\u"+Integer.toHexString(s.charAt(1)));
System.out.println("\u6c49\u5b57");
try
{
byte[] by = str.getBytes("GBK");
int i = by[0];
i=i<<8;
i+=by[1];
System.out.println(Integer.toHexString(i));
}
catch(Exception e)
{
e.printStackTrace();
}