This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach 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 Murach's Java Servlets and JSP this week in the Servlets 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 agree. Here's the link:
subject: File encoding ASCII & UTF8 && ISO
Similar Threads
how do i send a email test report from maven
Wagon-ssh with Maven 2.2
FATAL ERROR:The PluginDescriptor for the plugin Plugin [org.jvnet.jaxb2.maven2:mavenjaxb2-plugin]
Encoding Problems
emma-maven-plugin - filter excludes