Skip to content

java.nio.charset.UnsupportedCharsetException: cp0 on windows #2029

@spyrkob

Description

@spyrkob

I run into a following error when SSH'ing into WIndows and trying to run an app using picocli:

Exception in thread "main" java.nio.charset.UnsupportedCharsetException: cp0
        at java.nio.charset.Charset.forName(Charset.java:531)
        at picocli.CommandLine.charsetForName(CommandLine.java:15018)
        at picocli.CommandLine.getStderrEncoding(CommandLine.java:15013)
        at picocli.CommandLine.getErr(CommandLine.java:1310)
        at picocli.CommandLine.handleUnhandled(CommandLine.java:2189)
        at picocli.CommandLine.execute(CommandLine.java:2175)
        at CheckSum.main(CheckSum.java:33)

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:

FROM eclipse-temurin:8-nanoserver-1809
COPY demo.jar .
ENTRYPOINT java -jar demo.jar

I'm not sure if that should be treated in special way like cp65001 (#1474)?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions