Although there are certain posts in stackoverflow regarding file conversion to a specific charset format in java.In my case,I am receiving a csv file from a third party application and there after I need to process the data of this file and store them in DB.
Now,My system accept csv file in UTF-8 format but some time I am receiving files which are not in UTF-8 and moreover I am not able to track its charset type.
Now to convert an input csv file to UTF-8 its important to find out source file encoding type.In my case I am not able to track that.Have tried with InputStreamReader.getEncoding() or IOUtils classes
.But it output CP-1252
for both UTF-8 and non UTF-8 format file.
So,is there any way by which I can convert the incoming CSV file to UTF-8 format without having to identify its original source encoding?