Compare commits
2 commits
2a780f9eed
...
7a08e41148
| Author | SHA1 | Date | |
|---|---|---|---|
| 7a08e41148 | |||
| a85252732b |
1 changed files with 6 additions and 3 deletions
9
mew.pl
9
mew.pl
|
|
@ -8,16 +8,19 @@
|
||||||
# Copyright (c) 2023 Thomas Hochstein <thh@thh.name>
|
# Copyright (c) 2023 Thomas Hochstein <thh@thh.name>
|
||||||
|
|
||||||
use utf8;
|
use utf8;
|
||||||
|
use open qw(:std :encoding(UTF-8));
|
||||||
use Encode;
|
use Encode;
|
||||||
use MIME::QuotedPrint;
|
use MIME::QuotedPrint;
|
||||||
use MIME::Base64;
|
use MIME::Base64;
|
||||||
|
|
||||||
my $input = join (' ',@ARGV);
|
my $input = join (' ',@ARGV);
|
||||||
|
utf8::decode($input);
|
||||||
|
|
||||||
if ($input =~ /[\x80-\x{ffff}]/o) {
|
if ($input =~ /[\x80-\x{ffff}]/o) {
|
||||||
print encode('MIME-Q', $input);
|
$output = encode('MIME-Q', $input);
|
||||||
|
$output =~ s/=20/_/g;
|
||||||
} else {
|
} else {
|
||||||
print decode('MIME-Q', $input);
|
$output = decode('MIME-Q', $input);
|
||||||
};
|
};
|
||||||
|
|
||||||
print "\n";
|
print "$output\n";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue