|
use 5.014;
sub main {
my $inputStream = Console->OpenStandardInput();
my $bytes = "\0" x 100;
Console->WriteLine( "To decode, type or paste the UTF7 encoded string and " .
"press enter:" );
Console->WriteLine( "(Example: \"M+APw-nchen ist wundervoll\")" );
my $outputLength = do {
my $limit = length ( $bytes );
my $line = $inputStream ->getline();
chomp ( $line );
$bytes = substr ( $line , 0, $limit );
length ( $bytes );
};
my $chars = Encode::decode( 'UTF-7' => $bytes );
Console->WriteLine( "Decoded string:" );
Console->WriteLine( $chars );
return 0;
}
exit main();
|