docker-alpine-java
docker-alpine-java copied to clipboard
Trouble with locale
When building this image, locale def returns this to stderr:
LC_MONETARY: value of field
int_curr_symbol' has wrong length
No definition for LC_PAPER category found
No definition for LC_NAME category found
No definition for LC_ADDRESS category found
No definition for LC_TELEPHONE category found
No definition for LC_MEASUREMENT category found
No definition for LC_IDENTIFICATION category found`
This line of code running from within the JVM fails to format the number with a dollar sign, as expected:
BigDecimal subTotalAmount = 1.00
NumberFormat.getCurrencyInstance(Locale.US).format(subTotalAmount)
If I run this same code with LANG=C (the alpine default), the number works correctly.
Thanks for the report and example, will take a look
On Fri, Sep 2, 2016, 08:45 Nathan Warren [email protected] wrote:
When building this image, locale def returns this to stderr:
LC_MONETARY: value of field `int_curr_symbol' has wrong length No definition for LC_PAPER category found No definition for LC_NAME category found No definition for LC_ADDRESS category found No definition for LC_TELEPHONE category found No definition for LC_MEASUREMENT category found No definition for LC_IDENTIFICATION category found
This line of code running from within the JVM fails to format the number with a dollar sign, as expected:
BigDecimal subTotalAmount = 1.00 NumberFormat.getCurrencyInstance(Locale.US).format(subTotalAmount)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/anapsix/docker-alpine-java/issues/21, or mute the thread https://github.com/notifications/unsubscribe-auth/ABMrB_5jwtSbux6jSHAjInv1Fdm0E15hks5qmESmgaJpZM4Jz1mP .
I think, I've fixed it in the fixing_jce branch. Do you mind giving it a try @natewarr?
No change in functionality for me. When I set LANG=C back, my build/tests ran successfully.
We ended up having to do something similar. The following lines were added to the Dockerfile (which may not be relevant for all users), such that Java could reference the correct LANG.
Set the locale
ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8
The image we used was the following:
anapsix/alpine-java 8_server-jre_unlimited 9534edbd085f 5 weeks ago 125.2 MB
ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 Why did I fail to set it up like this?