-
Notifications
You must be signed in to change notification settings - Fork 78
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
Fix STDIN input encoding for Windows #447
base: master
Are you sure you want to change the base?
Conversation
Not sure why this test fails:
The test does not fail on my laptop.. |
Perhaps in your p.r. at line 223 the return value was an empty string. That would be a defined value, but then at 229 the first argument to |
To fix a test failure, I am checking if it is caused by Win32::GetConsoleCP() returning an empty string
@jkeenan Added a test for empty string, see last commit |
I'm not sure if we can use Encode here like that; MakeMaker is part of perl's bootstrap which means it's used before Encode is built. ExtUtils::MakeMaker::Locale is some prior art in this area. |
Then as an alternative, would it be possible to apply this patch to e.g. IO::Prompt::Tiny instead and patch consumers like CPAN::Shell to use |
No. CPAN::Shell is core so can't use any module outside of core. And I didn't you can't use Encode at all, I'm just saying it should handle its absence gracefully. |
Yes, nice one! For reference here is a link to the PR from 2014: #125 |
@Leont But why then can
|
Use bundled local module to determine windows codepage instead.
Trying with ExtUtils::MakeMaker::Locale instead, see latest commit. Also added a test case. |
Forgot to increase test number in prompt.t
See cpan-testers/Test-Reporter-Transport-Metabase#3 and https://stackoverflow.com/q/77123411/2173773. I believe this might fix the issue.