Replicated: strawberry perl -v => This is perl 5, version 40, subversion 0 (v5.40.0) built for MSWin32-x64-multi-thread : same results as OP under Windows Terminal & cmd.exe or Windows Terminal & powershell
DB<2> x Term::ReadLine->ReadLine
0 'Term::ReadLine::Perl'
c:> chcp
Active code page: 437
c:> chcp 65001
Active code page: 65001
c:> perl -wde 1
Can't figure out your console, using stdin: No such file or directory
Loading DB routines from perl5db.pl version 1.80
Editor support available.
Enter h or 'h h' for help, or 'perldoc perldebug' for more help.
main::(-e:1): 1
DB<1> x "§"
0 '§'
CP437 only has § in the 0x15, which is in the control codes section, so maybe upder CP437, it's being treated as a NAK which might confuse Term::ReadLine
Switching back to powershell, the chcp 65001 doesn't fix everything, because when I paste in
x "§"
I get
x "§"
Specifically:
PS C:\Users\pryrt> chcp
Active code page: 437
PS C:\Users\pryrt> chcp 65001
Active code page: 65001
PS C:\Users\pryrt> perl -wde 1
Can't figure out your console, using stdin: No such file or directory
Loading DB routines from perl5db.pl version 1.80
Editor support available.
Enter h or 'h h' for help, or 'perldoc perldebug' for more help.
main::(-e:1): 1
DB<1> x "§"
0 '§'
DB<2> x Win32::GetACP()
0 1252
DB<3> x Win32::GetOEMCP()
0 437
DB<4> x Win32::GetConsoleCP()
0 65001
DB<5> x Win32::GetConsoleOutputCP()
0 437
when looking at the same Win32 functions under the now-working cmd.exe environment, the difference is that Win32::GetConsoleOutputCP() is 65001, not 437.
So then in the powershell window, I tried:
DB<6> Win32::SetConsoleOutputCP(65001)
DB<7> x "§"
0 '§'
Yep.
Hope this helps.
edits: fix code/pre tags to get § to show up right in the various locations |