Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Slovak characters are getting messed up when reading from csv file in java

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.

like image 227
Infotechie Avatar asked Nov 03 '22 21:11

Infotechie


1 Answers

This is because of your encoding. You are creating your InputStreamReader with "ISO-8859-2" encoding.

Try using "UTF-8".Also check what's the encoding of your file.

like image 68
Serdar Dogruyol Avatar answered Nov 12 '22 18:11

Serdar Dogruyol