I am trying to read a comma separated file through InputStream containing some Slovak characters so I am passing proper character encoding in InputStream parameter.
But still characters are getting messed up.
InputStreamReader stream = new InputStreamReader(inputStreamToExcel,"ISO-8859-2");
For e.g. dd890èš becomes dd890č
Last two Slovak characters got messed up.
Please help.
org.apache.commons.lang.StringEscapeUtils escapeHtml(value) resolved the problem. Through escapeHTML I was able to see the exact html entity code that helps me in analyzing that the correct character was read by the application.But when it is assigned to String it is somehow getting converted to wrong format. But when the unescapedHtml string is passed on to view it is properly displayed by the browser because browser understands the HTML entity code properly.
References: http://www.w3schools.com/tags/ref_ascii.asp
http://www.alanwood.net/demos/ansi.html
This is my analysis.If anyone has any points to add on then please add.