Skip to main content

Different default character encoding type in Mojarra 2.1.6 compared to 2.1.26?

4 replies [Last post]
niba80
Offline
Joined: 2013-11-08
Points: 0

Hi,

I recently upgraded the JSF-version in our web application from Mojarra 2.1.6 to 2.1.26 and suddenly all servlet responses came back with a different character encoding. In Mojarra 2.1.6 we recieve responses back in 'ISO-8859-1' but now it's in 'UTF-8'.

Read through all release notes since 2.1.6 and I can't find any changes refering to this. Could anyone confirm if this has been changed?

Thanks,

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
softfact
Offline
Joined: 2013-12-17
Points: 0

You are right,

Somewhere between Mojarra versions 2.1.6 and 2.1.26 the default encoding for JSF view was changed from ISO-8859-1' to 'UTF-8'.

see:
public static final String CHAR_ENCODING = "ISO-8859-1";

public static final String CHAR_ENCODING = "UTF-8";

in com.sun.faces.RIConstants.java

the remedy for that is - explicitly set the encoding in the f:view tag:

jyeary
Offline
Joined: 2004-07-20
Points: 0

It looks like it was changed in 2.1.8. I don't see anything in the release notes that indicates why this should have been changed.

niba80
Offline
Joined: 2013-11-08
Points: 0

Thanks for the confirmation. This was something I suspected...

softfact
Offline
Joined: 2013-12-17
Points: 0

f:view encoding="ISO-8859-1"