Skip to content

[Feature]: Add utf-8 support by default #141

@TeseySTD

Description

@TeseySTD

Feature Description

Enabling UTF-8 encoding by default in lib runtime.

Problem Statement

We've encountered UI issues caused by the console using non-UTF-8 encodings. Since RazorConsole relies heavily on Unicode rendering, I propose enabling UTF-8 by default in the library runtime.

Proposed Solution

Add a small runtime initializer that safely switches the process to UTF-8:

public static class RuntimeEncoding
{
    public static void EnsureUtf8()
    {
        try
        {
            Console.InputEncoding  = Encoding.UTF8;
            Console.OutputEncoding = Encoding.UTF8;
        }
        catch
        {
            // Ignore – some environments don't allow changing encodings
        }
}

Alternatives Considered

No response

Additional Context

No response

Contribution

  • I'd be willing to contribute this feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions