Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3484584
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:48:18+00:00 2026-05-18T10:48:18+00:00

I have a java file in Eclipse that is in UTF-8 and has some

  • 0

I have a java file in Eclipse that is in UTF-8 and has some strings containing accents.

In the java file itself, the accent is written and saved as é .
In the xml that is generated using velocity the é becomes é
In the pdf that is generated using fop and and an xsl template, the output is displayed as é

So this is probably an encoding issue and everything should be in UTF-8. What’s weird is that locally in my eclipse environment (windows) where I run the application, the whole process works and the correct accents é are displayed in the pdf.

However when the application is built with maven and deployed to a (unix environment) I see the problem described above.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T10:48:19+00:00Added an answer on May 18, 2026 at 10:48 am

    Perhaps Eclipse is compiling the file with a different javac command line than Maven.

    When you compile Java, you have to tell the compiler the encoding of the source files (if they contain non-ASCII characters and the default doesn’t work).

    javac -encoding utf8 MyCode.java
    

    I think the way to fix this in Maven is to add this to your pom.xml file:

    <project>
      ...
      <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
      </properties>
      ...
    </project>
    

    (I got that from a Maven FAQ about a slightly different issue.)

    You could instead avoid the encoding issue entirely by using ugly Unicode escape sequences in your Java file. é would become \u00e9. Worse for humans, easier for the toasters. (As Perlis said, “In man-machine symbiosis, it is man who must adjust: The machines can’t.”)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java process that opens a file using a FileReader. How can
Say I have a binary file (generated with Java) containing a 32 bit int
I have utf-8 file which I want to read and display in my java
I am developing a java based eclipse plugin that monitors file activity. I need
I have a Java file TestThis.java like the following: class A { public void
If I have a Java source file (*.java) or a class file (*.class), how
I have a medium size Java file. Everytime I make a change to one
I have a java.hprof.txt file (automatically generated after an OutOfMemoryError) which I would like
I have a properties file in java, in which I store all information of
I have to read a binary file in a legacy format with Java. In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.