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

Wrong response charset when accessing files using VFS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 8.4.6, 11.10.4
    • VFS
    • None
    • Unknown

    Description

      Steps to reproduce :

      • Start a clean XWiki instance, install the VFS API
      • Upload the attached zip file to Main.WebHome, this zip contains just one simple file named "default.html", UTF-8 encoded with the following content :
      <!doctype html>
      <html>
        <head>
          <meta charset="utf-8"/>
          <title>blah É à È</title>
        </head>
        <body>
          <p>I'm the content, here are some accents : É à È</p>
        </body>
      </html>
      
      • In the content of a page, put the following :
      {{velocity}}
      [[take the test VFS>>path:$services.vfs.url("attach:Main.WebHome@test.zip/default.html")||target="_blank"]]
      {{/velocity}}
      
      • Save and view, click on the link

      Expected :

      • The HTML page displays nicely

      Actual :

      • We have character encoding issues

      The server response contains the following header : Content-Type: text/html;charset=iso-8859-1 ; which seems to be the root cause of the issue, forcing a specific charset here : https://github.com/xwiki/xwiki-platform/blob/9902e01cd365546dd6185ad6a7c8ce905b11e1f0/xwiki-platform-core/xwiki-platform-vfs/xwiki-platform-vfs-api/src/main/java/org/xwiki/vfs/internal/AbstractContentResourceReferenceHandler.java#L60 resolves the bug

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              caubin Clément Aubin
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: