I have a java application that processes a lot of text, Text representing data from many countries and languages.
I have to read in the data, process (web service calls) and write out the logs.
I changed the encoding-scheme while reading streams from default to use UTF-8 to support Chinese characters and it worked fine.
When i was using the default system encoding-scheme, the application supported charactes in German Language but when i made the change to use UTF-8, my application no longer supports German characters. It shows as ? and so on.
I can make the change to default again and process German characters but is there not a way to read a file, get its encoding format and configure the input stream reader to use this encoding format to read and configure log4j to use this format to write them out again.
Any pointers to the right direction is much appreciated.
Just to be clear, with the default encoding the code works with German text, and with UTF-8 it works with Chinese text? That sounds as if the code is not properly processing inputs that come in various encodings. You should never rely on the default encoding - the code should always be aware of what encoding any input is in, and act accordingly.