What is the meaning of the following?
String s = "some text here";
byte[] b = s.getBytes("UTF-8");
Does it mean, that the content in b
is now encoded with UTF-8
or
that we just got simple 0,1 Bytes from a string, which was encoded in UTF-8? Aren't all strings in java encoded in utf-16?
What is the Java's internal represention for String? Modified UTF-8? UTF-16?
Sometimes I see the following too:
byte ptext[] = myString.getBytes("ISO-8859-1");
String value = new String(ptext, "UTF-8");