I have issue with spanish characters in javastring. I have a content in a file and when i try to transform it to java object using InputStreamReader, the output of some string is "cÃ³mo" which should be "cómo".
when i try to display the value in browser it is displaying entity(ó) instead of literal (ó).
In that code fragment you simply send the result of your transformation to a String. But you're complaining about how something appears in the browser. So there must be a process which sends that String to the browser. You should consider the possibility that the String is being converted to bytes in an incorrect way at some point.
To me it looks like the data is being sent to the browser as UTF-8, but the header says that page is encoded in some other charset. Although you've just described what you saw as "the output of some string", which I have no idea what that means in reality. A more complete description of the problem would be helpful. Including such things as what encoding you used in that InputStreamReader, what encoding the file was written in, where the transformation fits into the picture, why your transformer's output gets sent to a String, and so on.
Perhaps you ought to just stick with the code which produces the HTML entity, since at least that looks correct in the browser.