Skip to content

Handling of special characters in getchar #821

@pkch

Description

@pkch

When the user presses arrow up, the click.getchar() returns b'\xe0'. This behavior is probably good, but I guess it should be documented (along with other special characters), since it's not a valid utf-8 value even though the terminal encoding is utf-8. (The naive click.getchar().decode('utf-8') would crash on this example with UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 0: unexpected end of data.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions