I need your help here please. I\'m working on a java application that convert data from a txt file into the database , The problem is that the file have ANSI encoding which
Use open a decoding Reader like this one:
Reader reader =
new InputStreamReader(inputStream, Charset.forName(encodingName));
Exaclty which encoding name you should use depends on which "ANSI" encoding the text file was written in. You can find a list of encoding supported by Java 6 here. If it is an English-language system, it will likely be windows-1252
.
Writing data to the database correctly depends on configuring the database correctly and (sometimes) providing the right configuration to the JDBC driver.
You can read more about character encoding handling in here and here.