Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-5268

DownloadAction forces encoding when it should not

    XMLWordPrintable

Details

    • Unknown

    Description

      When xwiki serves a file using the DownloadAction the content type is set by the app server with a charset apprended to it. For example for an HTML file you get in the headers of the HTTP request:

      Content-Type text/html; charset="iso-8859-1"

      This charset is not controled by XWiki but by the AppServer. Now if the file is binary there is no problem but if the file is an HTML file then the encoding will be forced to iso-8859-1 even if inside the HTML file the encoding says UTF-8 and the HTML file won't display correctly.

      This particularly impact the usage of the ZipExplorerPlugin which allows to browse a zipped HTML collection which can be of any content type. If the content type is not matching what the app server says then you get special characters badly displayed.

      Setting the character set to none seems to work in Jetty (it would need to be verified the impact on tomcat or other app servers) and the header becomes:

      Content-Type text/html; charset=""

      And with that header HTML files with encoding set in the HTML headers display properly.

      Attachments

        Issue Links

          Activity

            People

              sdumitriu Sergiu Dumitriu
              ludovic Ludovic Dubost
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: