Uploading PDFs containing different Unicode Prime symbols results in "Malformed input or input contains unmappable characters" errors


   

プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。

このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。

*Fisheye および Crucible は除く

要約

Uploading PDFs containing different Unicode Prime symbols results in "Malformed input or input contains unmappable characters" errors

環境

Java 17

診断

When attaching/uploading PDFs containing Unicode Prime symbols (e.g: ' `→) and saving the page, it shows a pink error rectangle with the following error message:

Error rendering macro 'view-file' Malformed input or input contains unmappable characters: <FILE-NAME>



原因

Java is pulling the wrong encoding (ANSI_X3.4-1968) even with the LANG=en_US.UTF-8 setup:

  <java-runtime-environment>
    <confluence.child-macro.max-depth>4</confluence.child-macro.max-depth>
    <java.specification.version>17</java.specification.version>
    <sun.jnu.encoding>ANSI_X3.4-1968</sun.jnu.encoding>
...
    <file.encoding>ANSI_X3.4-1968</file.encoding>
...
    <native.encoding>ANSI_X3.4-1968</native.encoding>


背景

(lightbulb)Similar to Bitbucket KB: Accented or extended UTF-8 characters cause "Malformed input or input contains unmappable characters" error

(info) To make the solution persistent, we apply the setup differently in Confluence to Java 17 by using the LC_ALL= variable. If we use the LANG= setup, Java will rollback the change soon after exporting the variable:

When we try to use the LANG=en_US.UTF-8 variable, Java seems to ignore the configuration so it doesn't work:

@HKGGFCQWPG java % export LANG=en_US.UTF-8
@HKGGFCQWPG java % java getcharset.java
Default Charset: US-ASCII
Default Charset by InputStreamReader: ASCII
Default Charset: US-ASCII


 On the other hand when using the LC_ALL=en_US.UTF-8 variable, we see Java persistently using the UTF-8 as required.

@HKGGFCQWPG java % export  LC_ALL=en_US.UTF-8
@HKGGFCQWPG java % java getcharset.java
Default Charset: UTF-8
Default Charset by InputStreamReader: UTF8
Default Charset: UTF-8

ソリューション

Setting up the LC_ALL=en_US.UTF-8 variable in setenv.sh file or in the user profile that runs Confluence. Restart the application.


最終更新日 2024 年 9 月 18 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.