Compare commits

...

2 commits

Author SHA1 Message Date
7a08e41148 mew: Use minimal encoding.
Signed-off-by: Thomas Hochstein <thh@thh.name>
2026-05-30 12:48:59 +02:00
a85252732b mew: Fix encoding.
Signed-off-by: Thomas Hochstein <thh@thh.name>
2026-05-30 12:48:18 +02:00

9
mew.pl
View file

@ -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";