Hello,
This
question already tackles the following problem, but the answer seems a bit blurry to me.
If you can create a
String object with the following constructor ( link:
http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#String%28byte[],%20java.nio.charset.Charset%29 ), then I guess this charset information is stored in the String object somewhere. Is there a way to retrieve this information?
From what I understand, encoding and underlaying bytes of data are not connected, only with correct encoding information you can display text correctly (from raw bytes).
However, String can be constructed with encoding in mind (and consequently it is not just plain byte array), probably there is a way to retrieve it somehow?