4 lines
127 B
Java
4 lines
127 B
Java
|
|
String s = "Hello, world!";
|
||
|
|
int byteCountUTF16 = s.getBytes("UTF-16").length;
|
||
|
|
int byteCountUTF8 = s.getBytes("UTF-8").length;
|