Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-36557

Multibyte characters don't get rendered in Confluence 5.7 on Linux

      Multibyte characters ( like Japanese or Chinese ) does not get rendered in Confluence 5.7

      Steps to reproduce

      1. Upload Excel file which contains Japanese characters to a page in Confluence.
      2. Click on the spreadsheet

      Actual results

      Japanese characters are displayed as squares.

      Findings

      This issue does not happen when using Office Excel macro
      This issue does not happen on Word documents
      This issue does not happen when Confluence runs on Windows 7

      Solution

      This bug has been "fixed" in Confluence 5.8.8, but you still need a directory that contains the fonts used to create the document (please follow the Plugin Configuration section). There are no workarounds for this (except in some very specific cases see the "Optional configuration" section below), but to get the best rendering for all file types you will need the original fonts.

      Caveats:
      • If you're running 5.7 or 5.8 you can replace the existing plugin used to do the rendering with the fixed version. We can't provide support for this method, but it's being mentioned here to help those who can't upgrade their Confluence instance right away. We strongly recommend testing this on your staging instance before making any changes to your production environment.
      • Replacing the plugin can't be done using the "Manage Add-ons" administration screen due to the size of the plugin (it may work if your instance has enough heap allocated to Java, but your system will use more memory after installing it this way, so please don't do this and follow the provided instructions instead).
      Plugin installation

      To install the plugin on your system safely, do the following:

      1. Stop your Confluence instance.
        If you are running Confluence in a cluster, all nodes must be stopped, and the following steps repeated on each node (we are manually replacing a plugin, so if all the nodes are not stopped there's the chance that nodes may run with different versions of the library, which will cause all sort of problems)
      2. Go to your Confluence home directory, and go to the plugins-osgi-cache/transformed-plugins/ directory.
      3. Delete any document-conversion-library-1.X.XX_YYYYYY.jar files there, where X and Y are numbers (the numbers will be different, depending on your Confluence version). There can be more than one (depending on how many upgrades you've done to your instance). Please check the name of the file, there is a similar file called confluence-document-conversion-library... which should not be touched.
      4. In your Confluence installation directory, go to WEB-INF/atlassian-bundled-plugins and delete the file document-conversion-library-1.X.XX.jar. There should only be one this time.
      5. In the same directory, copy the new plugin jar document-conversion-library-1.2.12.jar, provided at the end of this description.
      Plugin configuration

      Now that we have the plugin installed, we need to specify a directory with all the fonts. This directory won't be recursively searched, so don't add any sub-directories as they won't be used.

      1. We need to specify the following parameter to Confluence as a JVM argument: confluence.document.conversion.fontpath. To do so, you can modify the setenv.sh (or setenv.bat if you're running Confluence under Windows Server) and add the following to CATALINA_OPTS: -Dconfluence.document.conversion.fontpath=/your/font/path. See https://confluence.atlassian.com/display/DOC/Configuring+System+Properties for more information on how to do this.
      2. If you want Confluence to re-render all existing thumbnails & PDFs, remove the files rendering cache from the Confluence shared home directory (if you're not on cluster, there should be a shared-home directory in the Confluence home directory). Remove dcl-document (containing the PDF previews) and dcl-thumbnail (containing the thumbnails). Be aware that this will trigger Confluence to re-render every document. It will do this as people visit pages containing files, not all at once.
      3. If you don't remove the files rendering cache, the new fonts will be visible the next time somebody uploads a new document, or uploads a new version of an existing file.
      4. Start Confluence.
      5. To confirm the change, go to the "Manage Add-ons" administration screen. Search for "Document Conversion Library" and check that you're running version 1.2.12.
      Optional configuration

      Other JVM flags that were added and might help with this issue:

      Flag Default value Description
      confluence.document.conversion.words.defaultfontname   The name (not the path) of the default font that will be used for Word rendering (.doc and .docx). A default font can be specified here that contains all the glyphs for your language(s)
      confluence.document.conversion.slides.defaultfontname.regular   The name (not the path) of the default font that will be used for Powerpoint rendering (.ppt and .pptx) for regular fonts
      confluence.document.conversion.slides.defaultfontname.asian TakaoPGothic The name (not the path) of the default font that will be used for Powerpoint rendering (.ppt and .pptx) for asian fonts
      confluence.document.conversion.slides.defaultfontname.symbol   The name (not the path) of the default font that will be used for Powerpoint symbols rendering (.ppt and .pptx). This is the font that will be used for bullets and other symbols when the font Symbol is not found

      The new plugin can be downloaded here: https://maven.atlassian.com/service/local/repositories/atlassian-public/content/com/atlassian/plugins/document-conversion-library/1.2.12/document-conversion-library-1.2.12.jar

        1. 2015-05-28-confluence-5.7-excel-preview-embedded.png
          2015-05-28-confluence-5.7-excel-preview-embedded.png
          77 kB
        2. 2015-05-28-confluence-5.7-excel-preview-expanded.png
          2015-05-28-confluence-5.7-excel-preview-expanded.png
          95 kB
        3. 2015-05-28-confluence-5.7-ppt-office-connector.png
          2015-05-28-confluence-5.7-ppt-office-connector.png
          110 kB
        4. 2015-05-28-confluence-5.7-ppt-preview-embedded.png
          2015-05-28-confluence-5.7-ppt-preview-embedded.png
          59 kB
        5. 2015-05-28-confluence-5.7-ppt-preview-expanded.png
          2015-05-28-confluence-5.7-ppt-preview-expanded.png
          61 kB
        6. 2015-05-28-confluence-5.7-word-office-connector.png
          2015-05-28-confluence-5.7-word-office-connector.png
          19 kB
        7. 2015-05-28-confluence-5.7-word-preview-embedded.png
          2015-05-28-confluence-5.7-word-preview-embedded.png
          15 kB
        8. 2015-05-28-confluence-5.7-word-preview-expanded.png
          2015-05-28-confluence-5.7-word-preview-expanded.png
          6 kB
        9. Confluence是一个专业的企业知识管理与协同软件.doc
          12 kB
        10. Confluence是一个专业的企业知识管理与协同软件.doc
          12 kB
        11. Emb_excel.png
          Emb_excel.png
          33 kB
        12. Emb_ppt.png
          Emb_ppt.png
          56 kB
        13. Emb_word.png
          Emb_word.png
          7 kB
        14. Excel file conversion test.xlsx
          28 kB
        15. Expand_excel.png
          Expand_excel.png
          74 kB
        16. Expand_ppt.png
          Expand_ppt.png
          55 kB
        17. Expand_word.png
          Expand_word.png
          18 kB
        18. powerpoint file conversion test.ppt
          258 kB
        19. pptx_1.png
          pptx_1.png
          40 kB
        20. pptx_2.png
          pptx_2.png
          28 kB
        21. pptx_3.png
          pptx_3.png
          39 kB
        22. pptx_test.pptx
          32 kB
        23. spreadsheet.jpg
          spreadsheet.jpg
          140 kB
        24. test1.xlsx
          10 kB
        25. View.png
          View.png
          98 kB
        26. Word file conversion test.docx
          12 kB
        27. 캡처.PNG
          캡처.PNG
          162 kB

            [CONFSERVER-36557] Multibyte characters don't get rendered in Confluence 5.7 on Linux

            Limwantaek added a comment -

            it is not fixed.

            can found this bug docker image atlassian/confluence-server:latest

            Limwantaek added a comment - it is not fixed. can found this bug docker image atlassian/confluence-server:latest

            Hi viktar.bachkouski
            Could you please add some test files ( doc, xls ) for Cyrillic that does not work on Confluence Cloud so we can verify what does not work and add the missing fonts.

            Feel free to attach them to your Support Case if you do not want them to be available on the public facing issue. https://support.atlassian.com/browse/CSP-192995

            Cheers
            – Jonas - Confluence Cloud QE Team Lead

            Jonas Soderstrom (Inactive) added a comment - - edited Hi viktar.bachkouski Could you please add some test files ( doc, xls ) for Cyrillic that does not work on Confluence Cloud so we can verify what does not work and add the missing fonts. Feel free to attach them to your Support Case if you do not want them to be available on the public facing issue. https://support.atlassian.com/browse/CSP-192995 Cheers – Jonas - Confluence Cloud QE Team Lead

            I emphasize. This issue is on our server. And in your Confluence Cloud.

            Tony Montana added a comment - I emphasize. This issue is on our server. And in your Confluence Cloud.

            I have followed this approach - it works. However, when trying to roll-back (deleted document-conversion-library-1.2.12.jar, fonts, CATALINA_OPT variable, caches) I can't replicate issue anymore - characters are still showing fine. Are fonts cached somewhere else? How come I am not able to reproduce the issue after roll-back?

            Deleted Account (Inactive) added a comment - I have followed this approach - it works. However, when trying to roll-back (deleted document-conversion-library-1.2.12.jar , fonts, CATALINA_OPT variable, caches) I can't replicate issue anymore - characters are still showing fine. Are fonts cached somewhere else? How come I am not able to reproduce the issue after roll-back?

            Confluence 5.10 still problem

            Tony Montana added a comment - Confluence 5.10 still problem

            James Richards added a comment - Also see https://confluence.atlassian.com/confkb/the-text-in-a-powerpoint-excel-or-word-document-looks-different-when-using-the-viewfile-macro-200213562.html

            After implementing your Solution, Japanese fonts of Excel can be also dislayed normally in Embedded Preview and Expanded Preview.
            If there is any other problem, we'll report report here again.

            Thank you for your cooperation!

            Hanayo Minamisawa,
            Ricksoft Inc.

            Ricksoft Co., Ltd. added a comment - After implementing your Solution, Japanese fonts of Excel can be also dislayed normally in Embedded Preview and Expanded Preview. If there is any other problem, we'll report report here again. Thank you for your cooperation! Hanayo Minamisawa, Ricksoft Inc.

            @Sam Tardif

            Fonts need to be copied to a path within /usr/share/fonts (any directory in there should work, e.g. /user/share/fonts/truetype/microsoft), and you should ensure that you copy the same font that you used to create the document. You'll then need to restart Confluence and the fonts will be picked up.

            I am in the same situation above you.
            I've done Mr. Tardif's advice, copying fonts in /usr/share/fonts/ms, but It's useless.
            Cannot see ms excel preview document encoded by Korean.

            ByeongSu Kang added a comment - @Sam Tardif Fonts need to be copied to a path within /usr/share/fonts (any directory in there should work, e.g. /user/share/fonts/truetype/microsoft), and you should ensure that you copy the same font that you used to create the document. You'll then need to restart Confluence and the fonts will be picked up. I am in the same situation above you. I've done Mr. Tardif's advice, copying fonts in /usr/share/fonts/ms, but It's useless. Cannot see ms excel preview document encoded by Korean.

            Ricksoft Co., Ltd. added a comment - - edited

            Dear Sam Tardif -san,

            Thank you for your comment.

            Fonts need to be copied to a path within /usr/share/fonts (any directory in there should work, e.g. /user/share/fonts/truetype/microsoft), and you should ensure that you copy the same font that you used to create the document. You'll then need to restart Confluence and the fonts will be picked up.

            We installed MS Japanese fonts (msgothic.ttc and msmincho.ttc) which used in the test files to /user/share/fonts/truetype/ , Word and PPT can be displayed in Preview screen, but Excel is still garbled.
            (We verified with Rakuten-san Test files.)

              Word Excel PPT
            Embedded Preview Correct
            Garbled
            Correct
            Expanded Preview Correct
            Garbled
            Correct

            Could you please verify whether this phenomenon can be reproduced?

            Hanayo Minamisawa,
            Ricksoft Inc.

            Ricksoft Co., Ltd. added a comment - - edited Dear Sam Tardif -san, Thank you for your comment. Fonts need to be copied to a path within /usr/share/fonts (any directory in there should work, e.g. /user/share/fonts/truetype/microsoft), and you should ensure that you copy the same font that you used to create the document. You'll then need to restart Confluence and the fonts will be picked up. We installed MS Japanese fonts (msgothic.ttc and msmincho.ttc) which used in the test files to /user/share/fonts/truetype/ , Word and PPT can be displayed in Preview screen, but Excel is still garbled. (We verified with Rakuten-san Test files .)   Word Excel PPT Embedded Preview Correct Garbled Correct Expanded Preview Correct Garbled Correct Could you please verify whether this phenomenon can be reproduced? Hanayo Minamisawa, Ricksoft Inc.

            Hi pavlova,

            Can you read stardif comments above about installing the fonts? It should fix your problem right away. Just remember to copy the same fonts used in your documents for the best results and you'll be good to go.

            Angel Eduardo Garcia Hernandez (Inactive) added a comment - Hi pavlova , Can you read stardif comments above about installing the fonts? It should fix your problem right away. Just remember to copy the same fonts used in your documents for the best results and you'll be good to go.

              egarcia Angel Eduardo Garcia Hernandez (Inactive)
              htoussi HosseinA
              Affected customers:
              18 This affects my team
              Watchers:
              38 Start watching this issue

                Created:
                Updated:
                Resolved: