two days ago i started using tomahawk ExtensionsFilter components im my jsf application.
i noticed that all javascript alerts were not displaying special characters (ç, ã, ó ô), it displays things like #231 instead.
When i remove ExtensionsFilter from my web.xml file, javascript displays allright.
Anybody had this issue before?
thanks in advance.
EDIT:
i was able to solve the problem by creating a filter before the extensionFilter, this new filter force the REQUEST charset to utf-8. But this is an ugly solution, a better solution, as balusC said, would be to get rid of all the inline javascript.
Thank you all for the help!
A few other ideas:
-Dfile.encodingwindow.alertso that it escapes the charactersThis seems to work, but would be a very, very ugly hack. This would also be very limited and won’t work if javascript sets other texts, e.g. content of a
div.UPDATE:
Here is the sequence that is suspect:
1) ExtensionsFilter intercepts the request
2) ExtensionsFilter contains
3) DefaultAddResource uses HtmlResponseWriterImpl which uses UnicodeEncoder.
4) All “non basic latin characters” are then encoded.
Conclusion
file.encoding&#xx;could work but is extremely ugly.I don’t have other ideas right now, but I’m interested in the answer as I also bumped on encoding issue which were annoying.
UPDATE 2:
You could give a try to AspectJ to alter just the part of the MyFaces library that relates to the encoding form within the filter. According to my understanding of
cflowand thecallpointcut pickings, something like this might intercept the encoding when it happens from the filter. If this definition creates other interferences in the request processing, you might want to also consider the call toaddResource.writeResponseto limit further the pointcut.