usenet-tools/mew.pl
Thomas Hochstein 7a08e41148 mew: Use minimal encoding.
Signed-off-by: Thomas Hochstein <thh@thh.name>
2026-05-30 12:48:59 +02:00

26 lines
458 B
Perl

#! /usr/bin/perl -w
#
# mew.pl
#
# converts from and to MIME encoded words
#
#
# Copyright (c) 2023 Thomas Hochstein <thh@thh.name>
use utf8;
use open qw(:std :encoding(UTF-8));
use Encode;
use MIME::QuotedPrint;
use MIME::Base64;
my $input = join (' ',@ARGV);
utf8::decode($input);
if ($input =~ /[\x80-\x{ffff}]/o) {
$output = encode('MIME-Q', $input);
$output =~ s/=20/_/g;
} else {
$output = decode('MIME-Q', $input);
};
print "$output\n";