This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes File encoding ASCII & UTF8 && ISO Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "File encoding ASCII & UTF8 && ISO" Watch "File encoding ASCII & UTF8 && ISO" New topic

File encoding ASCII & UTF8 && ISO

christian leclerc
Ranch Hand

Joined: Apr 08, 2008
Posts: 38
Hello ranch guy's,
I've got a big encoding problems and this is cost me a lot of times for nothing.

Here my problems :

I've got an application that create a report. The report has some french accent like : é
When I test the file in eclipse the repor (witch is an .txt file ) t is encoded in utf-8.
I make an executable jar with maven2 and after running the program with java -jar the report is encoded in us-ascii.

Im on opensuse and the command file -i is giving me the information.

So i already set the default charset to the JVM with several options.
When the code execute I
and the result is UTF-8.
But the file is encoded in text plain us-ascii :

$file-i report.txt
report.txt: text/plain; charset=us-ascii

The same file with eclipse is
$file-i report.txt
report.txt: text/plain; charset=utf-8

Well .. I dont know what to do to make my file to be an utf-8 outside eclipse.

Maven assembly is with some plugins:

an the properties of the project are :

Well, if someone can help me on that, It will be very great because i'm really stuck here.

Best regards,


I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: File encoding ASCII & UTF8 && ISO
It's not a secret anymore!