当我在带有 CP850 的 WinXP 终端中运行此脚本时,Ü
并且ö
显示正确。当我取消注释该use Win32::Console::ANSI;
行时,输出被破坏。
这种行为是可以预期的还是这是一个错误?
#!perl
use warnings;
use strict;
use 5.10.0;
binmode STDOUT, ':encoding(cp850)';
use Encode qw(decode_utf8);
use URI::Escape qw(uri_unescape);
#use Win32::Console::ANSI;
my $uri_escaped = '%C3%9Cberraschungsei+R%C3%B6ntgen';
say $uri_escaped;
my $uri_unescaped = uri_unescape( $uri_escaped );
say $uri_unescaped;
my $utf8_decoded = decode_utf8( $uri_unescaped );
say "Result: $utf8_decoded";
%C3%9Cberraschungsei+R%C3%B6ntgen
"\x{009c}" does not map to cp850 at C:perl.pl line 15.
Ã\x{009c}berraschungsei+Röntgen
Result: Überraschungsei+Röntgen
%C3%9Cberraschungsei+R%C3%B6ntgen
"\x{009c}" does not map to cp850 at C:perl.pl line 15.
Ç\x{009c}berraschungsei+RÇôntgen
Result: sberraschungsei+R"ntgen