in reply to Printing cyrillic strings in cmd.exe

The following works for me:

my $string = "\x{0410}\x{0411}\x{0412}"; # unicode binmode STDOUT, ":encoding(cp1251)"; print $string, "\n";

or

my $string = "\xc0\xc1\xc2"; # cp1251 print $string, "\n";

(Of course, you also have to set the appropriate code page ("chcp 1251") and use a font that contains the cyrillic glyphs.)

In case you want to specify the literal strings in your perl code in UTF-8 (rather than as unicode codepoints), you'd have to use utf8 to tell Perl that your script is encoded in UTF-8.

Replies are listed 'Best First'.
Re^2: Printing cyrillic strings in cmd.exe
by pshangov (Acolyte) on Jan 23, 2007 at 12:50 UTC
    thanks, the "chcp" command, which I was not aware of, solved the problem!