Several things come to mind that you could investigate. First, since you specify the content type using JSP, remove the various HTML meta tags. I can easily see that confusing the browser. Secondly, do you set the content type of the response before retrieving anything from it? That is to say, after getting values from the response and before writing them to disk, are they OK? Lastly, are you using the proper encoding when writing the values to a file? If you specify no encoding, the default one is used, and that is not UTF-8.