-
Notifications
You must be signed in to change notification settings - Fork 422
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
java.nio.charset.UnsupportedCharsetException: cp0 on windows #2029
Comments
@spyrkob Thank you for raising this! Looking back at #1474, I can see that cp65001 is equivalent to UTF-8 on Windows, but Java does not recognize it as such. Hence, it is safe to use UTF-8 when picocli detects that system property What about In fact, is it valid for this windows nanoserver docker image to use CP0? Is this not a bug or misconfiguration in the windows nanoserver docker image? I am not convinced that picocli should introduce special code to work around this... (I cannot find CP0 in the Windows code page entry. In the general code page Wikipedia entry I see it is "reserved", unsure that that means... I cannot find anything on Microsoft's web site. I have my doubts that this is a valid value.) |
From what I was able to find, it seems code page As a side note - I first run into the same issue on a full Windows machine when SSH'ing into it but I was not able to come up with reliable reproducer. |
Oh interesting! Can you provide links to what you found?
Does that mean that any java application in nanoservers will have code page zero? (If that is true, that sounds like a bug in nanoserver...)
How should a command line program behave when |
After some more digging I have to say I'm getting increasingly confused by the code page 0 :). According to https://learn.microsoft.com/en-us/windows/console/getconsolecp 0 is an error, but looking at error details it seems that the operation was successfull. I asked a question on Microsoft Q&A hopefully there'll be some clarification
Just to clarify - by
Let me ask a different question - why is the output charset handled differently in Picocli then in JVM? |
That’s a good suggestion (doing something similar to the Console example). Makes sense to modify picocli to behave similarly, maybe with some added Trace logging at INFO level if the Will you be able to provide a pull request for this? |
Sure. Thanks for your feedback! |
I run into a following error when SSH'ing into WIndows and trying to run an app using picocli:
It seems that happens when code page is set to "0". The error can be reproduced when using a windows nonoserver docker image, e.g. using following Dockerfile:
I'm not sure if that should be treated in special way like cp65001 (#1474)?
The text was updated successfully, but these errors were encountered: