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 6880343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:57:43+00:00 2026-05-27T04:57:43+00:00

I have a file encoded in UTF-8 which I want to read in java,

  • 0

I have a file encoded in UTF-8 which I want to read in java, change some things in the input and print the result to terminal (standard output) and to another file. I read and write the files and write to stdout with streams constructed to interpret UTF-8 encoding.

Everything is fine when I’m manually compiling and running everything, the output file contains UTF-8 signs, the stdout also prints them to terminal.

The problem is when I want to compile and run the program using ant. The output (written to terminal) produced by ant doesn’t seem to use UTF-8 signs, as Polish diactrics are changed to ‘?’. Is there any way of forcing ant to use UTF-8? Also, can I check somehow which encoding is it using at present?

I searched for an answer, but all I found was how to make ant interpret UTF-8 encoded .java files.

  • 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-27T04:57:44+00:00Added an answer on May 27, 2026 at 4:57 am

    You could try setting -Dfile.encoding=UTF-8 this will set the encoding to UTF-8.

    You may also want to check if your console encoding is UTF-8 (depends on the OS).

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

Sidebar

Related Questions

I have an UTF-8 encoded txt file and I want to import it to
I have to import some UTF-8 encoded text-file into my C++Builder 5 program. Are
I have an html file which is shift-JIS encoded (Japanese), and I cannot read
I have UTF-8 encoded XML file, which has Chinese characters. Questions are: Should I
I have an XSD file that is encoded in UTF-8, and any text editor
I have a text file that is encoded in UTF-8. I'm reading it in
I am having utf-8 encoded file containing arabic text and I have to search
I currently have an encoded footer file for a wordpress file I want to
I have an HTML file (encoded in utf-8). I open it with codecs.open() .
I have an XML document file.xml which is encoded in Iso-latin-15 (aka Iso-Latin-9) <?xml

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.