We have a maven--jetty-based Java app deployed on heroku.
Locally, when I do:
System.out.println("Default Charset = "+ Charset.defaultCharset());
String s = "Resumé of Schrödinger";
System.out.println("s = "+ s);`
I see (as expected):
Default Charset = UTF-8
s = Resumé of Schrödinger
But, when I push the app to heroku, and check the logs, I see:
Default Charset = US-ASCII
s = Resum?? of Schr??dinger
Actually, I'm facing further problems because of this, since we have to Decode Base-64 encoded text which has UTF-8 encoded characters.
I have even tried the following with no use:
SAXBuilder builder = new SAXBuilder();
InputStream iStream = new ByteArrayInputStream(xmlAsString.getBytes("UTF-8"));
Reader reader = new InputStreamReader(iStream, "UTF-8");
InputSource is = new InputSource(reader);
is.setEncoding("UTF-8");
And later, when doing org.apache.commons.codec.binary.Base64.decodeBase64(byte [])
I am even doing stringObject.getBytes("UTF-8")
But still, I am unable to see the characters like e-acute(é), umlaut(ö), etc.
Is there any way to solve this on Heroku?
The jdk version in pom.xml is 1.6
Is it a quirk of the OpenJDK 1.7 & the virtual machine underneath in Heroku?
Thanks in advance.