from java.lang.StringCoding :
String csn = (charsetName == null) ? \"ISO-8859-1\" : charsetName;
This is what is used from Java.lang.getByt
The parameterless String.getBytes()
method doesn't use ISO-8859-1 by default. It will use the default platform encoding, if that can be determined. If, however, that's either missing or is an unrecognized encoding, it falls back to ISO-8859-1 as a "default default".
You should very rarely see this in practice. Normally the platform default encoding will be detected correctly.
However, I'd strongly suggest that you specify an explicit character encoding every time you perform an encode or decode operation. Even if you want the platform default, specify that explicitly.