Not able to edit a file containing non-Latin and umlaut characters using the Office Connector macro

XMLWordPrintable

    • 9
    • Severity 3 - Minor
    • 23

      Issue Summary

      The problem is that editing files whose names include non-Latin and umlaut characters using an Office Connector macro doesn’t work and results in an exception while downloading the file.

      Steps to Reproduce

      1. Install Confluence 9.2.4 LTS or 9.4.1
      2. Save a file with any name in non-English language (eg. Att göra.docx or Iñtërnâtiônàlizætiøn.xlsx)
      3. Go to Administration     > General Configuration > Office Connector
      4. Enable both options below :
      5. Create a Page
      6. Upload the mentioned file
      7. Add the Office Excel macro and select the same file
      8. Save the Page.
      9. Click on the Edit Document link on the page. 

      Expected Results

      The file should be opened in MS Excel or MS Word in edit mode.

      Actual Results

      The MS Excel or MS Word throws an error pop-up as it's not able to open the file, as the filename gets corrupted.

      The URL of the files is not properly generated by Confluence with the Office Connector macro, for instance, the file name Att göra.docx and Iñtërnâtiônàlizætiøn.xls.xlsx is shown like below in the browser HTML code or dev console;

      <a href="/plugins/servlet/confluence/editinword/360474/attachments/I&amp;ntilde;t&amp;euml;rn&amp;acirc;ti&amp;ocirc;n&amp;agrave;liz&amp;aelig;ti&amp;oslash;n.xls.xlsx" class="confluence-button office-editable" data-use-path-auth="false">Edit Document</a>
      
      <a href="/plugins/servlet/confluence/editinword/360479/attachments/Att g&amp;ouml;ra.docx" class="confluence-button office-editable" data-use-path-auth="false">Edit Document</a>
      

      From the above output, the links for the above filenames are not rendered properly, so Confluence is unable to download the file from the instance. 

      The following exception is thrown in the atlassian-confluence.log

      2025-05-19 08:18:45,257 ERROR [http-nio-8090-exec-85 url: /confluence/500page.jsp] [atlassian.confluence.status.SystemErrorInformationLogger] logException Unhandled exception, request unique ID: af80acda-2ee0-43f1-bbeb-9945013767ce
       -- traceId: e604c3bae1d3db29
      java.lang.NullPointerException: Cannot invoke "com.atlassian.confluence.pages.Attachment.getFileName()" because "this.attachment" is null
      	at com.benryan.servlet.webdav.AttachmentResource.checkEditPermission(AttachmentResource.java:133)
      	at com.benryan.servlet.webdav.ResourceBuilder.buildAttachmentResource(ResourceBuilder.java:122)
      

      Workaround

      The functionality of editing these files via the Attachments menu (... > Attachments, Edit in Office) is still functioning properly, and the links to download files render well.

      One can also access the affected file as expected through: Attachment macro in the page content 

        1. Att göra.docx
          14 kB
        2. CONFSERVER-99832.mp4
          972 kB
        3. image-2025-05-22-21-09-06-111.png
          image-2025-05-22-21-09-06-111.png
          103 kB
        4. Iñtërnâtiônàlizætiøn.xlsx
          297 kB

            Assignee:
            agawron
            Reporter:
            Saurabh
            Votes:
            13 Vote for this issue
            Watchers:
            21 Start watching this issue

              Created:
              Updated:
              Resolved: