p4raw-id: //depot/perl@12934
For example:
$ENV{LANG} = 'ru_RU.KOI8-R';
- use open ':locale';
+ # the :locale will probe the locale environment variables like LANG
+ use open OUT => ':locale';
open(O, ">koi8");
print O chr(0x430); # Unicode CYRILLIC SMALL LETTER A = KOI8-R 0xC1
close O;
open(I, "<koi8");
- printf "%#x\n", ord(<I>), "\n"; # this should print 0xC1
+ printf "%#X\n", ord(<I>), "\n"; # this should print 0xC1
close I;
These are equivalent
%%%
# the special :locale layer
$ENV{LANG} = 'ru_RU.KOI8-R';
-use open ':locale';
+# the :locale will probe the locale environment variables like LANG
+use open OUT => ':locale';
open(O, ">koi8");
print O chr(0x430); # Unicode CYRILLIC SMALL LETTER A = KOI8-R 0xC1
close O;
open(I, "<koi8");
-is(ord(<I>), 0xC1, ":locale");
+printf "%#X\n", ord(<I>), "\n"; # this should print 0xC1
close I;
%%%