Filesystem encoding is written as ANSI_X3.4-1968 even though the server is set to UTF-8
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Symptoms
The following appears in the atlassian-confluence.log
:
1
fileSystemEncoding = ANSI_X3.4-1968
Another symptom:
Workbox Notification shows ERR_CONTENT_DECODING_FAILED
When exporting to PDF, texts that include special characters such as accents do not get printed. For example, instead of printing é and ü, the PDF export will display e and u.
Diagnosis
Run the command su -l -c locale confluence
to find the following result:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
Cause
The filesystem encoding in Confluence has been set to ANSI_X3.4-1968. This encoding can cause issues in Confluence as the encoding supported in Confluence is only UTF-8
Solution
Resolution
In
setenv.sh
, add the following JVM parameter by editing the line below before the export CATALINA_OPTS parameter:1 2 3 4
CATALINA_OPTS="-Dfile.encoding=UTF-8 -Djavax.servlet.request.encoding=UTF8 ${CATALINA_OPTS}" export LC_ALL=en_US.UTF-8 export LANG=en_US.UTF-8 export LANGUAGE=en_US.UTF-8
(If you are running an old Confluence's version, you might need to use the parameter below instead of the CATALINA_OPTS variable:)
1
JVM_SUPPORT_RECOMMENDED_ARGS="-Dfile.encoding=utf-8
Take the following additional steps if you use Redhat or Ubuntu:
In Redhat 6.x (RPM-Based distributions), set the LANG and LC_ALL values in /etc/sysconfig/i18n as follows:
1 2
LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8"
In Redhat 7.x (RPM-Based distributions), run the following command:
1
sudo localectl set-locale LANG="en_US.UTF-8"
In Ubuntu (Debian and Debian-based distributions), set the LANG and LC_ALL values in /etc/default/locale as follows:
1 2
LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8"
You must use the default locale entry that is common to your language for the UTF-8 character set, the choice en_US.UTF-8 is the correct choice for US English language, while your language may vary
Related articles:
Was this helpful?