String string to get bytecode

String snn = "中华";
byte
[] buff = snn.getBytes("UTF-8"); int i = buff.length; The System. OUT .println (i);
// can digital (i) obtained, the conversion (China)

 

Guess you like

Origin www.cnblogs.com/yanchaohui/p/11889565.html