-
-
Notifications
You must be signed in to change notification settings - Fork 13
Default encoding is ANSI_X3.4-1968 instead of UTF-8 #739
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
Comments
See https://openjdk.org/jeps/400. So you might want to try JDK 19 (or soon 20). In particular this section from Motivation section of the JEP:
Setting environment |
Frankly, this is totally wrong I know this is and old issue, but still I'm running into it again: % LC_ALL=en_US.UTF-8 /usr/lib/jvm/java-11-openjdk/bin/java -XshowSettings:all 2>&1 | grep jnu.encod Note that setting LC_ALL is bad practise, and setting LC_PAPER to en_US.UTF-8 is ridiculous too. So this is supposedly fixed? % LANG=C.utf8 /usr/lib/jvm/java-21-openjdk/bin/java -XshowSettings:all 2>&1 | grep jnu.encod ... nope! |
This is still a problem. I have tried setting all the variables mentioned to en_US.UTF-8, C.utf8 and all variations thereof |
Before:
Fixed container file:
Build it with:
Check results:
What's the difference (in container files)?
|
I dont use adoptiums docker containers for this. The app I have issues with this is shipped as a archive which contains an adoptium jdk and start scripts. After trial and error I found out that it must be capital UTF-8 so "export LANG=C.UTF-8" is was trying with lower casr utf-8... I managed to get it to work.... finally... The main problem I had was that this appeared to be platform specific. I.e. it worked on my machine but failed on someone elses linux box. Issues such as these always surface in production and that makes them nasty surprises. Anyhow I am sorted out now. Thanks for taking the time to respond to this. |
Please provide a brief summary of the bug
It seems as though in situations where no locale has been set (e.g. in docker containers) temurin java defaults to expect file encoding
ANSI_X3.4-1968
. However UTF-8 is the defacto standard, so I would expect that to be the default.Please provide steps to reproduce where possible
Dockerfile:
then to build and run...
Expected Results
I expect the java properties to show
file.encoding
sun.stdout.encoding
sun.stderr.encoding
etc to be some form ofUTF-8
encoding.This is true if I run the
java -XshowSettings:properties -version
command in a temurin java 17 docker container, which is why I'm creating the issue here rather than on the docker source repository.Actual Results
What Java Version are you using?
openjdk version "17.0.6" 2023-01-17 OpenJDK Runtime Environment Temurin-17.0.6+10 (build 17.0.6+10) OpenJDK 64-Bit Server VM Temurin-17.0.6+10 (build 17.0.6+10, mixed mode, sharing)
What is your operating system and platform?
Ubuntu 20.04 on amd64 architecture.
Docker version:
How did you install Java?
in docker by copying from the official image (see reproduction steps)
Did it work before?
No response
Did you test with the latest update version?
No response
Did you test with other Java versions?
Relevant log output
No response
The text was updated successfully, but these errors were encountered: