Skip to content

CentOS 8: Wrong encoding #60

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ariksidney opened this issue Apr 27, 2021 · 2 comments · Fixed by #62
Closed

CentOS 8: Wrong encoding #60

ariksidney opened this issue Apr 27, 2021 · 2 comments · Fixed by #62
Labels

Comments

@ariksidney
Copy link

Hi there,

I discovered that transforming a file from csv to pdf with alfresco-transform-misc and umlauts is not working properly. After digging a bit around, I saw that the default encoding which is picked up by Java on the CentOS 8 image is ANSI_X3.4-1968 instead of UTF-8.

To reproduce the issue:

  • Start a container from the alfresco-docker-base-java image (There will be some locale related warnings)
  • When executing a simple Java method which prints System.getProperty("file.encoding"), ANSI_X3.4-1968 is returned instead of UTF-8.

I think adding the following environment variable to the Dockerfile should be enough to fix it.
ENV LC_ALL C.UTF-8

Thanks!

@mteodori
Copy link
Member

mteodori commented Jun 14, 2021

I see that setting you mention though: https://github.com/Alfresco/alfresco-docker-base-java/blob/master/Dockerfile#L21

But only on Centos 8 images, if I run locally I can see:

docker run -it alfresco/alfresco-base-java:11.0.11-centos-8
bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
/bin/sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
[root@8fb5737cc2b3 /]# jshell
Jun 14, 2021 9:06:14 PM java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
|  Welcome to JShell -- Version 11.0.11
|  For an introduction type: /help intro

jshell> System.out.println(System.getProperty("file.encoding"));
ANSI_X3.4-1968

mteodori added a commit that referenced this issue Jun 14, 2021
* broken in commit a2bf7ba
* fixes #60
@mteodori
Copy link
Member

tracked internally at https://alfresco.atlassian.net/browse/OPSEXP-923

mteodori added a commit that referenced this issue Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants