不知道有什么办法将 utf-8 的字串转成 unicode( ucs-2 )?
我用了
new String(str.getBytes("UTF-8"),"ISO-10646-UCS-2");
但是得到一堆问号
另外, ucs-2 与 UTF-16 是什么关系, 有人说他们是一样的,不知道真假的.
我用了
new String(str.getBytes("UTF-8"),"ISO-10646-UCS-2");
但是得到一堆问号
另外, ucs-2 与 UTF-16 是什么关系, 有人说他们是一样的,不知道真假的.
public static String toISO(String strvalue) {
try{
if (strvalue == null)
return null;
else
strvalue = new String(strvalue.getBytes("utf-8"), "ISO-10646-UCS-2");
return strvalue;
}catch(Exception e){
return null;
}
}