當我在活動代碼頁爲65001的Windows控制檯中運行此腳本時,如果輸入ö
(U + 00F6),則返回undef
。這是否意味着InputChar
不適用於cp65001
?Win32 :: Console:InputChar和codepage 65001
#!perl
use warnings;
use strict;
use 5.10.0;
use Devel::Peek;
use Win32::Console;
my $in = Win32::Console->new(STD_INPUT_HANDLE);
$in->Mode(ENABLE_PROCESSED_INPUT);
my $char = $in->InputChar();
Dump $char;
say "{$char}";
C:>chcp 65001
Active code page: 65001
C:>perl.pl
SV = NULL(0x0) at 0x12b6fac
REFCNT = 1
FLAGS = (PADMY)
Use of uninitialized value $char in concatenation (.) or string at ... line 21.
{}
對人沒有必要的語言鍵盤得到
AöBöCöDö10
到程序誰希望測試這個,按住'Alt'並在*鍵盤上輸入'148' * – Borodin