I’m using the WildFly 10 distrubution for Windows and the built in H2 database for development. In my JSF application I can upload a CSV file which works fine locally. When I copy the .war file to the server (CentOS 7) and upload the CSV file I got question marks in strings in the database. Seems like there is an encoding problem.
So far I have checked to make sure that from the JSF form comes UTF-8 with
I think what your example with input stream does, is telling InputStreamReader to read bytes as UTF-8, while in reality file contains another encoding. So when you read it, it doesn’t match. If that assumption is correct, possible solutions would be either to convert file to UTF-8, or tell InputStreamReader to use iso-8859-1.
I’ve just re-read the link and you’re right.
As the information stored in the database will be also shown in lists on the web seems like I have to convert it.
Thanks @aakhmerov