in reply to setlocale not working properly in perl script
$ LC_CTYPE='en_US.UTF-8' perl -Mlocale -le'my $ch = chr(0x2660); print + length($ch);' 1 $ LC_CTYPE='en_US' perl -Mlocale -le'my $ch = chr(0x2660); print + length($ch);' 1 $ LC_CTYPE='en_US.UTF-8' perl -Mlocale -MEncode -le'my $ch = chr(0x266 +0); my $bytes = encode("utf-8", $ch); print length($bytes);' 3 $ LC_CTYPE='en_US' perl -Mlocale -MEncode -le'my $ch = chr(0x266 +0); my $bytes = encode("utf-8", $ch); print length($bytes);' 3
Could you provide a suitable test? I'm not all that familiar with locales.
|
|---|