I would like to ask again: Can anyone tell me why MyFaces converts
unicode characters to their &#xyz; equivalents when we invoke
facesContext.getResponseWriter().writeAttribute("id", myName);
Here myName contains a string which contains a unicode character 'ae'
that is the equivalent of æ.
I am outputting UTF-8 XML in which all unicode characters are acceptable
except XML special characters like < and &, so I do not understand why
'ae' is converted to æ when 'ae' is itself legal XML.
Randahl
Randahl Fink Isaksen wrote:
According to the JSF1.1 spec section 6.4 the ResponseWriter
implementation should be "performing
appropriate character encoding and escaping", but I think MyFaces
seems to have taken this a bit too far. Not only does it escape
characters which has a special meaning in XML, like the < character,
it also escapes national characters like the Danish 'ae' character
which it transforms to its escape equivalent ("æ"). This seems to
me to be completely unnecessary when outputting unicode formatted XML,
since unicode supports 'ae' and since 'ae' does not have a special
meaning in XML.
This turns out to be a problem in my application of MyFaces because I
would like to output something like this:
<div id="Vandmærke">
where the "æ" should in fact have been the danish letter 'ae'.
Can anyone elaborate on why MyFaces would do this and/or if this
behavior can be configured to work otherwise?
Thanks
Randahl