I've a bunch of chinese characters in say DB or XML file. They are stored there using UTF-8 encoding.
And now i need to get this information in my Java code. I read the XML using DOM parser and stored the chinese character in a String literal. This is later displayed in the JSP Page and printed in the System out console.
It is working fine. I do not know why?
As per my understanding, Java should use the proper encoding (in this case UTF-8) to store the Chinese character. But when I checked the default encoding used by JVM it is not UTF-8 or 16. It is some Cp1522(not sure if this is correct, I cannot recollect the correct value, my apologies).
So it should not be able to print the values right? Could you please help to know why this is working?