Skip to content
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

Unable to input full-width characters #432

Closed
Pandaft opened this issue Jul 29, 2023 · 3 comments
Closed

Unable to input full-width characters #432

Pandaft opened this issue Jul 29, 2023 · 3 comments
Labels
upstream_issue This issue is caused by an upstream package

Comments

@Pandaft
Copy link

Pandaft commented Jul 29, 2023

Environment:

  • Windows 10 22H2
  • Python 3.11.4
  • python-inquirer 3.1.3

Code:

import inquirer

answers = inquirer.prompt([
    inquirer.Text('msg',
                  message="message"),
])

Reproduce:

When I try to type Chinese:

1

It turned out:

2

This problem also occurs with other full-width characters, such as Korean and Japanese.

@Cube707
Copy link
Collaborator

Cube707 commented Jul 29, 2023

This stems from the libary function readchar using only the msvcrt.getch() function, which only returns single bytes (Its old, from a time where ascii was the only characterset).

There are plans to fix that in an upcoming version, but there's no timeframe on when I will come around to it.

@Cube707 Cube707 added the upstream_issue This issue is caused by an upstream package label Jul 30, 2023
@Cube707
Copy link
Collaborator

Cube707 commented Jul 30, 2023

Relevant: magmax/python-readchar#93

sakkyoi added a commit to sakkyoi/python-readchar that referenced this issue Aug 10, 2024
Cube707 pushed a commit to sakkyoi/python-readchar that referenced this issue Aug 11, 2024
Cube707 pushed a commit to magmax/python-readchar that referenced this issue Aug 11, 2024
closes #93

* fix full-width characters issue (magmax/python-inquirer#432)

* Fix the issue that raises a bunch of OSError exceptions in the test script (#93)

* Fix UnicodeEncodeError when inputting emojis

* add tests for new unicode support
@Cube707
Copy link
Collaborator

Cube707 commented Aug 12, 2024

closed by #622

@Cube707 Cube707 closed this as completed Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream_issue This issue is caused by an upstream package
Projects
None yet
Development

No branches or pull requests

2 participants