I am reading a properties file that consists of a message in a UTF-8 character set.
Problem
The output is not in the appropriate format. I am using InputStream .
The properties file looks like
username=LBSUSER password=Lbs@123 url=http:
And I read the file like this,
Properties props = new Properties(); props.load(new FileInputStream("uinsoaptest.properties")); String username = props.getProperty("username", "test"); String password = props.getProperty("password", "12345"); String url = props.getProperty("url", "12345"); int timeout = Integer.parseInt(props.getProperty("timeout", "8000")); String messagetext = props.getProperty("message"); System.out.println("This is soap msg : " + messagetext);
Result of the above message:

You can see the message in the console after the line
{************************ SOAP MESSAGE TEST***********************}
I would appreciate it if I could help by reading this file correctly. I can read this file with a different approach, but I am looking for less modification code.
java encoding parsing utf-8
Som
source share