怎么讓字符串中轉(zhuǎn)為utf8編碼格式?
String str = "任意字符串";str = new String(str.getBytes("gbk"),"utf-8");備注說明:str.getBytes("UTF-8"); 的意思是以UTF-8的編碼取得字節(jié)new String(XXX,"UTF-8"); 的意思是以UTF-8的編碼生成字符串
怎么讓字符串中轉(zhuǎn)為utf8編碼格式?
String str = "任意字符串";str = new String(str.getBytes("gbk"),"utf-8");備注說明:str.getBytes("UTF-8"); 的意思是以UTF-8的編碼取得字節(jié)new String(XXX,"UTF-8"); 的意思是以UTF-8的編碼生成字符串