Reading Euro(€) from property file

Posted on 2005-05-13
Medium Priority
Last Modified: 2010-05-18

Can anybody give a solution for the below problem.

i have got a property file which has a got a euro(€) symbol in one of the property values.
like COMEDY_ANGRYKID.savetargetprice=(€1).
i want to read this value and comapre with another value that is stord in XML file.

i am using below code for reading the property file.
                  props.load(new FileInputStream(                  propertiesDirectory + "/nowletFunctions.properties"));
definitly it is not returning me the proper value.Euro is not supported in ISO 8859-1  encoding which property file is using.
i have tried changing the Locale by passing -Duser.language=en -Duser.region=IE_EURO but no use.

How i can read that value from property file? is there is any other solution rather than changing the property file to XML file for storing the values.

All inputs are welcome.

manoj velliyatt

Question by:manojvelliyatt
  • 3
LVL 37

Expert Comment

ID: 13995948
Why not use "eur" instead of "€"?
LVL 86

Expert Comment

ID: 13996197


or it could be


LVL 86

Accepted Solution

CEHJ earned 2000 total points
ID: 13996834

That's the one. Works fine for me. Don't try to print it to the console unless the console can support it. Instead  try

JOptionPane.showMessageDialog(null, props.getProperty("COMEDY_ANGRYKID.savetargetprice"));
LVL 86

Expert Comment

ID: 13998069

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses
Course of the Month15 days, 16 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question