字符串的getBytes()

byte[] b = test.getBytes();

In the api it is specified that if we do not specify character encoding it takes the default platform character encoding.



It means the default character encoding of the JVM that you're running on,

To check the default encoding you can do the following:

System.getProperty("file.encoding");

that will return the default encoding (and the one used by getBytes() above).


你可能感兴趣的:(字符串的getBytes())