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

Status macro titles display as square characters in the edit mode using Chinese or Korean font

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • 6.3.3, 6.5.1, 6.11.0, 7.1.0, 7.3.1, 7.7.3, 7.8.0, 7.13.0, 7.19.4, 8.0.0, 8.0.3, 7.13.13, 8.2.1, 8.5.14, 9.0.0
    • Macros - Other Macros

      Summary:

      Confluence Status Macro titles display as square characters in the edit mode with Chinese/Japanese/Korean (CJK) fonts

      Steps to Reproduce

      1. Create a page in latest Confluence version
      2. Edit the page
      3. Use status macro whose title is in Chinese "用户编辑了这个页面"
      4. Check that the title gets garbled in the Edit mode 

      Expected results

      The Macro title should display Chinese characters in the edit mode.

      Actual Results

      Attached is the screen shot which shows the garbled characters

      Cause

      In edit mode the status macro is rendered as an image, where are in view mode it's HTML span.

      URL for the image in edit is

      and in edit mode we can see the HTML is

      <img class="editor-inline-macro" height="18" width="88" src="/plugins/servlet/status-macro/placeholder?title=%E7%94%A8%E6%88%B7%E7%BC%96%E8%BE%91%E4%BA%86%E8%BF%99%E4%B8%AA%E9%A1%B5%E9%9D%A2" data-macro-name="status" data-macro-parameters="title=用户编辑了这个页面" data-macro-schema-version="1" data-macro-id="4101f99e-6663-4475-9e3f-45ba83058259"> 

       In view mode the HTML is

      <span class="status-macro aui-lozenge conf-macro output-inline" data-hasbody="false" data-macro-name="status">用户编辑了这个页面</span> 

       

      Workaround

      • Remove if there are any Arial fonts exist in the system with fc-list command.
      • Issue may arise even if the Arial font is not installed.

            [CONFSERVER-53262] Status macro titles display as square characters in the edit mode using Chinese or Korean font

            Adam Yao added a comment -

            如果你能看到这个页面,欢迎你,来自中国的朋友!

            针对中文有几处问题:

            1、宏的标题显示方框;

            • 解决:这是因为linux无法渲染西文以外的字符,只需要安装中文字体到系统即可;
              step1. 检查 以下地址无法正确加载出字符:
              <conf-host>/plugins/servlet/status-macro/placeholder?title=%E6%9C%AA%E5%BC%80%E5%A7%8B&colour=Grey
              $ fc-list :lang=zh
              ### nothing here!
              

              step2.安装:

              ### 可选使用阿里中国镜像源
              $ sed --in-place "s/archive.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list
              $ sed --in-place "s/security.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list
              $ apt update
              $ apt-get install fonts-wqy-zenhei
              

              step3.重启服务。

            2、doc文件预览显示方框;

            • 解决:这是因为文档转换没有配置正确的字体目录;
              step1. 增加环境变量:
              ### 字体目录来自上一步(可自定义)
              sed -i '118i CATALINA_OPTS="-Dconfluence.document.conversion.fontpath=/usr/share/fonts/truetype/wqy \${CATALINA_OPTS}"' /opt/atlassian/confluence/bin/setenv.sh
              

              step2. 重启服务。

            3、pdf导出显示方框;

            • 解决:PDF导出语言支持 页面上传中文字体即可;
              http://<conf-host>/admin/flyingpdf/configurepdflanguagesupport.action

            resolved

            There are a few issues with displaying Chinese characters that Chinese users should be aware of:

            1. Square boxes appearing in macro titles

            • Solution: This is because Linux systems cannot render characters outside of Western languages. To fix this, you need to install Chinese fonts on the system:
              Step 1: Check if Chinese fonts are already installed by running the following command:
              $ fc-list :lang=zh
              ### If nothing appears, proceed to the next step.
              

              Step 2: Install the fonts. You can use the Alibaba Cloud mirror to install the fonts. Run the following commands:

              ### Optionally use the Alibaba Cloud mirror source
              $ sed --in-place "s/archive.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list
              $ sed --in-place "s/security.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list
              $ apt update
              $ apt-get install fonts-wqy-zenhei
              

              Step 3: Restart the service.

            2. Square boxes appearing in doc file previews

            • Solution: This is because the document conversion hasn't been configured with the correct font directory. Follow these steps:
              Step 1: Add an environment variable by running the following command:
              ### The font directory comes from the previous step (can be customized)
              sed -i '118i CATALINA_OPTS="-Dconfluence.document.conversion.fontpath=/usr/share/fonts/truetype/wqy \${CATALINA_OPTS}"' /opt/atlassian/confluence/bin/setenv.sh
              

              Step 2: Restart the service.

            3. Square boxes appearing in PDF exports

            • Solution: You need to upload Chinese fonts to the PDF export language support page. Follow these steps:
              Step 1: Go to the PDF export language support page:
              http://<conf-host>/admin/flyingpdf/configurepdflanguagesupport.action
              

              Step 2: Upload the Chinese fonts on the page.

            Adam Yao added a comment - 如果你能看到这个页面,欢迎你,来自中国的朋友! 针对中文有几处问题: 1、宏的标题显示方框; 解决:这是因为linux无法渲染西文以外的字符,只需要安装中文字体到系统即可; step1. 检查 以下地址无法正确加载出字符: <conf-host>/plugins/servlet/status-macro/placeholder?title=%E6%9C%AA%E5%BC%80%E5%A7%8B&colour=Grey $ fc-list :lang=zh ### nothing here! step2.安装: ### 可选使用阿里中国镜像源 $ sed --in-place "s/archive.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list $ sed --in-place "s/security.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list $ apt update $ apt-get install fonts-wqy-zenhei step3.重启服务。 2、doc文件预览显示方框; 解决:这是因为文档转换没有配置正确的字体目录; step1. 增加环境变量: ### 字体目录来自上一步(可自定义) sed -i '118i CATALINA_OPTS= "-Dconfluence.document.conversion.fontpath=/usr/share/fonts/truetype/wqy \${CATALINA_OPTS}" ' /opt/atlassian/confluence/bin/setenv.sh step2. 重启服务。 3、pdf导出显示方框; 解决:PDF导出语言支持 页面上传中文字体即可; http://<conf-host>/admin/flyingpdf/configurepdflanguagesupport.action — resolved There are a few issues with displaying Chinese characters that Chinese users should be aware of: 1. Square boxes appearing in macro titles Solution: This is because Linux systems cannot render characters outside of Western languages. To fix this, you need to install Chinese fonts on the system: Step 1: Check if Chinese fonts are already installed by running the following command: $ fc-list :lang=zh ### If nothing appears, proceed to the next step. Step 2: Install the fonts. You can use the Alibaba Cloud mirror to install the fonts. Run the following commands: ### Optionally use the Alibaba Cloud mirror source $ sed --in-place "s/archive.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list $ sed --in-place "s/security.ubuntu.com/mirrors.aliyun.com/g" /etc/apt/sources.list $ apt update $ apt-get install fonts-wqy-zenhei Step 3: Restart the service. 2. Square boxes appearing in doc file previews Solution: This is because the document conversion hasn't been configured with the correct font directory. Follow these steps: Step 1: Add an environment variable by running the following command: ### The font directory comes from the previous step (can be customized) sed -i '118i CATALINA_OPTS= "-Dconfluence.document.conversion.fontpath=/usr/share/fonts/truetype/wqy \${CATALINA_OPTS}" ' /opt/atlassian/confluence/bin/setenv.sh Step 2: Restart the service. 3. Square boxes appearing in PDF exports Solution: You need to upload Chinese fonts to the PDF export language support page. Follow these steps: Step 1: Go to the PDF export language support page: http: //<conf-host>/admin/flyingpdf/configurepdflanguagesupport.action Step 2: Upload the Chinese fonts on the page.

            Adam Yao added a comment - - edited

            the same issue +1

            my version:

             

            Confluence 8.2.1

            Adam Yao added a comment - - edited the same issue +1 my version:   Confluence 8.2.1

            NiYunfan added a comment - - edited

            Same issue +1

            We've upgraded to Confluence Server 7.13.7 a few days ago (since 2022-06-04), and it seems this issue suddenly occur this weekend.

            However, we have a test server with same confluence version, there's no such issue on it. Not sure what's the difference between our test server and production server.

             

            The workaround doesn't work for our production server, as we don't have such fonts.

            nothing match 

            fc-list | grep Arial

            fc-list | grep -i Arial

             

             

            NiYunfan added a comment - - edited Same issue +1 We've upgraded to Confluence Server 7.13.7 a few days ago (since 2022-06-04), and it seems this issue suddenly occur this weekend. However, we have a test server with same confluence version, there's no such issue on it. Not sure what's the difference between our test server and production server.   The workaround doesn't work for our production server, as we don't have such fonts. nothing match  fc-list | grep Arial fc-list | grep -i Arial    

            Lei Wang added a comment -

            Regardless Confluence version, this is the status macro plugin issue.

            Lei Wang added a comment - Regardless Confluence version, this is the status macro plugin issue.

            7.4.8(LTS) version has the same issue, too.

            Is there any workaround to fix it?

            sangHun LEE added a comment - 7.4.8(LTS) version has the same issue, too. Is there any workaround to fix it?

            7.7.3 version has the same issue, too.

            Is there any workaround to fix it?

             

            Seungmin Lee added a comment - 7.7.3 version has the same issue, too. Is there any workaround to fix it?  

            홍예림 added a comment -

            Using Confluence server 7.1.0 and having the same problem.

            Macro titles display as square characters in the edit mode with Korean fonts

            홍예림 added a comment - Using Confluence server 7.1.0 and having the same problem. Macro titles display as square characters in the edit mode with Korean fonts

            Andy G. Wi added a comment -

            The same problem occurring after upgrading to 7.3.1.

            Any update of this bug??

            Andy G. Wi added a comment - The same problem occurring after upgrading to 7.3.1. Any update of this bug??

            kuanchang zhang added a comment - - edited

            it seems not relative system fonts;

            img .src "url encoding  string" ,  it's maybe css or deplay error?

            kuanchang zhang added a comment - - edited it seems not relative system fonts; img .src "url encoding  string" ,  it's maybe css or deplay error?

              Unassigned Unassigned
              pyarakala Praveen Yarakala (Inactive)
              Affected customers:
              40 This affects my team
              Watchers:
              40 Start watching this issue

                Created:
                Updated: