I am getting a inputstream using
InputStream is = response.getEntity().getContent();
now i want to save it in UTF-8 file that preserves the language codes.
The input stream contains data in a different languages e.g chinese, japanese, hindi.
I tried using IOUtils, OutputStreamWriter but failed. The file is saved but it is something like ऩ Ӓ i want these codes to be actually saved in its equivalent symbol
You will have to first know what encoding the input data uses. Then you can using an InputStreamReader set to use that encoding, and an OutputStreamWriter set to use UTF-8. That should make the translation for you. If both input and output are in UTF-8, and you don't need to work with the data in your Java code, then you can skip both reader and the writer and just copy the bytes from input to output.