I have a problem with utf-8 encoding in primefaces 3. but with this (adding filter for character encoding in web.xml), my problem solved. But I have another filter for primefaces fileupload in my web.xml. In pages that there is fileupload, even without uploading anything, my character encoding filter don’t work and utf-8 character sets with unknown values, just like when there was no filter for uploading. How I can use this filter together?
Share
This is a bug in PrimeFaces’
MultipartRequest. It’s using the platform default character encoding for form fields instead of the one set in the HTTP servlet request as done byHttpServletRequest#setCharacterEncoding()in your character encoding filter (which I assume is been mapped inweb.xmlbefore the PrimeFacesFileUploadFilter).Basically, line 85 and 88 of
MultipartRequestin PrimeFaces 3.3needs to be changed as follows
I have reported it as issue 4266. In the meanwhile, your best bet is to manually fix the incorrect string encoding in the backing bean action method as follows, assuming that the server platform default encoding is ISO-8859-1: