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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T06:13:17+00:00 2026-05-27T06:13:17+00:00

I have a project where everything is in UTF-8. I was using the Properties.load(Reader)

  • 0

I have a project where everything is in UTF-8. I was using the Properties.load(Reader) method to read properties files in this encoding. But now, I need to make the project compatible with Java 1.5, and the mentioned method doesn’t exist in Java 1.5. There is only a load method that takes an InputStream as a parameter, which is assumed to be in ISO-8859-1.

Is there any simple way to make my project 1.5-compatible without having to change all the .properties files to ISO-8859-1? I don’t really want to have a mix of encodings in my project (encodings are already a time sink one at a time, let alone when you mix them) or change all my project to ISO-8859-1.

With “a simple way” I mean “without creating a custom Properties class from scratch”.

  • 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-27T06:13:17+00:00Added an answer on May 27, 2026 at 6:13 am

    One strategy that might work for this situation is as follows:

    1. Read the bytes of the Reader into a ByteArrayOutputStream.
    2. Once that is completed, call toByteArray() See below.
    3. With the byte[] construct a ByteArrayInputStream
    4. Use the ByteArrayInputStream in Properties.load(InputStream)

    As pointed out, the above failed to actually convert the character set from UTF-8 to ISO-8859-1. To fix that, a tweak.

    After the BAOS has been filled, instead of calling toByteArray()..

    1. Call toString("ISO-8859-1") to get an ISO-8859-1 encoded String. Then look to..
    2. Call String.getBytes() to get the byte[]
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background I have a project named PersonLibrary which has two files. Person.h Person.cpp This
I have the following MSBuild project file: <?xml version=1.0 encoding=utf-8?> <Project xmlns=http://schemas.microsoft.com/developer/msbuild/2003 DefaultTargets=Deploy ToolsVersion=4.0>
I have a project in Eclipse. When I run it from inside Eclipse, everything
I have produced a new Maven Project from gae-archetype-gwt from within IntelliJ, and everything
I'm building an ASP.Net MVC website. Rather than have everything in one project, I've
I have a project that I'm currently working on but it currently only supports
I have a project at work, and we use Subversion to version control everything.
I have a project with a formidable data access layer using LinqtoSQL for just
I have a project which has a calling structure similar to this: main project/application
I have a project using Git where I've branched off of master to rename

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.