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

bug: Unicode characters as command line arguments do not work as expected. #51

Closed
harvimt opened this issue Oct 19, 2019 · 6 comments
Closed

Comments

@harvimt
Copy link
Contributor

harvimt commented Oct 19, 2019

Describe the bug
Pyenv does not handle unicode arguments passed to an executable correctly.

To Reproduce
Steps to reproduce the behavior:
0. Make sure your console has a Unicode font (such as Deja Vu Sans Mono), the default font (Courier New) does not support some unicode characters.

  1. write a simple program to test sys.argv is passed in correctly (argvtest.py)
import sys
print(sys.argv[1])

Run it with some unicode arguments, and see that they are mangled.

Capture

Expected behavior
Unicode command line arguments are passed from are expected to work (on python3 at least)

Capture2

Screenshots
Included above.

Desktop (please complete the following information):

  • OS: Windows 10
  • cmd.exe (powershell exhibits slightly different behavior with the snowman emoji, and I can't tell why, so cmd.exe was used which shows the problem clearly)
  • pyenv and python versions

Additional context
Add any other context about the problem here.

@harvimt
Copy link
Contributor Author

harvimt commented Oct 19, 2019

ok. I've looked at the internals there are 2 bugs

  1. VBS chokes on the unicode outside the basic multilingual plane.
  2. exec.bat needs to have chcp 1250 (utf8) put at the top

2 is an easy fix. I don't know enough VBScript to fix the first problem.

@harvimt
Copy link
Contributor Author

harvimt commented Oct 19, 2019

hah. ok 1 ended up being medium easy as well I just had to google around for utf8 support.

PR incoming.

Unfortunately I do not know if this will affect git bash/linux subsystem at all (I suspect not? as they're already pretty utf8 aware)

@harvimt
Copy link
Contributor Author

harvimt commented Oct 19, 2019

of course what I had installed previously, and what's in HEAD are totally different.

the latest version errors differently... but still not ideal

Capture3

@harvimt
Copy link
Contributor Author

harvimt commented Oct 19, 2019

That should fix the problem, #52

I think.

@kirankotari
Copy link
Member

New release on Air. Closing this.

@kirankotari
Copy link
Member

@papercuptech @dedale this is broken in the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants