Java, Docker, CentOS and Encoding

On Centos 8 a glibc libary update (via e.g. yum update -y), may cause a reset of the locale to:


LANG=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
(...)
LC_ALL=
which causes Java applications to fallback to:

java.nio.charset.Charset.defaultCharset() => US-ASCII (and some investigation work to find out the proper name of attendees with non-US characters in their name for the airhacks.live or airhacks.com event registrations :-))

The command localedef -i en_US -f UTF-8 en_US.UTF-8 fixes the problem, but may lead to another one:


[error] character map file `UTF-8' not found: No such file or directory
[error] default character map file `ANSI_X3.4-1968' not found: No such file or directory    

Finaly, executing yum -y install glibc-locale-source prior to localedef -i en_US -f UTF-8 en_US.UTF-8 installs the missing files and changes back the locale.

Now locale reports again:


LANG=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
(...)
LC_ALL=

The Java 11 docker image in docklands already contains the here described fix.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
...the last 150 posts
...the last 10 comments
License