Skip to content

Box drawing characters don't print correctly after AnsiConsole.systemInstall() in cmd.exe #247

@codemonstur

Description

@codemonstur

I want to print some box drawing characters to the screen. Here is my code:

public static void main(final String... args) {
    AnsiConsole.systemInstall();
    System.out.println("\u2514\u2500");
}

However this prints:

C:\Projects\public\test>java -jar target/test.jar
ÔööÔöÇ

If I remove the AnsiConsole.systemInstall() I get this:

C:\Projects\public\test>java -jar target/test.jar
└─

On linux everything is fine. This only breaks on windows (tested with cmd.exe and Windows Home 11).
I do want to continue using AnsiConsole because I want to print colors. And that part works great. I don't want to have to choose between colors or fancy drawing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions