- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
#!/usr/bin/perl -w
use strict;
use warnings;
use v5.22;
use Encode qw(encode decode);
binmode $_, ':utf8' for qw(STDOUT STDIN);
my $c = 'KOI8-R';
print decode $c, join '', map {chr (ord() & 0x7F)} split '', encode $c, $_ while (<>);