I am trying to imagine a form with fields containing special characters, for example €ŠšŽžŒœŸ. As far as I can see on the ISO-8859-15 wikipedia page , these characters are included in the standard. Although the encoding for the request and response is set to ISO-8859-15, when I try to display the values (using FreeMarker 2.3.18 in the JAVA EE environment), the values ???????. I set the accepted encoding form to ISO-8859-15, I checked that the form is submitted with the content type text/html;charset=ISO-8859-15(using firebug), but I cannot figure out how to display the correct characters. If I run the following code, the correct hex value is displayed (ex: Ÿ = be).
What am I missing? Thank you in advance!
System.out.println(Integer.toHexString(myString.charAt(i)));
EDIT:
I have the following code while processing the request:
PrintStream ps = new PrintStream(System.out, true, "ISO-8859-15");
String firstName = request.getParameter("firstName");
for (int i = 0; i < firstName.length(); i++) {
ps.println(firstName.charAt(i));
}
BufferedWriter file=new BufferedWriter(new OutputStreamWriter(new FileOutputStream(path), "ISO-8859-15"));
file.write(firstName);
file.close();
source
share