Add mew.pl
Signed-off-by: Thomas Hochstein <thh@thh.name>
This commit is contained in:
		
							parent
							
								
									53c7ca4f2a
								
							
						
					
					
						commit
						fcf1faa41c
					
				
					 2 changed files with 27 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -5,3 +5,7 @@ This is a collection of tools around (managing) Netnews.
 | 
			
		|||
## canlockcheck
 | 
			
		||||
 | 
			
		||||
`canlockcheck.pl` will check whether a given Cancel-Lock and Cancel-Key match.
 | 
			
		||||
 | 
			
		||||
## mew
 | 
			
		||||
 | 
			
		||||
`mew.pl` will encode or decode MIME encoded words (RFC 2047).
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										23
									
								
								mew.pl
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								mew.pl
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,23 @@
 | 
			
		|||
#! /usr/bin/perl -w
 | 
			
		||||
#
 | 
			
		||||
# mew.pl
 | 
			
		||||
#
 | 
			
		||||
# converts from and to MIME encoded words
 | 
			
		||||
#
 | 
			
		||||
#
 | 
			
		||||
# Copyright (c) 2023 Thomas Hochstein <thh@thh.name>
 | 
			
		||||
 | 
			
		||||
use utf8;
 | 
			
		||||
use Encode;
 | 
			
		||||
use MIME::QuotedPrint;
 | 
			
		||||
use MIME::Base64;
 | 
			
		||||
 | 
			
		||||
my $input = join (' ',@ARGV);
 | 
			
		||||
 | 
			
		||||
if ($input =~ /[\x80-\x{ffff}]/o) {
 | 
			
		||||
   print encode('MIME-Q', $input);
 | 
			
		||||
} else {
 | 
			
		||||
   print decode('MIME-Q', $input); 
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
print "\n";
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue