This commit is contained in:
Nick Bebout 2016-09-19 10:17:24 -05:00
parent 3eaac56812
commit 137242e609
114 changed files with 10852 additions and 8980 deletions

21
W/learn/utf7_to_utf7imap Executable file
View file

@ -0,0 +1,21 @@
#!/usr/bin/perl
# $Id: utf7_to_utf7imap,v 1.1 2016/08/08 22:57:44 gilles Exp gilles $
use strict ;
use warnings ;
foreach my $str_utf7 ( @ARGV ) {
my $str_utf7imap = utf7_to_uft7imap( $str_utf7 ) ;
print qq{mv '$str_utf7' '$str_utf7imap'\n} ;
}
# http://cpansearch.perl.org/src/FABPOT/Unicode-IMAPUtf7-2.01/lib/Unicode/IMAPUtf7.pm
sub utf7_to_uft7imap {
my ( $s ) = @_ ;
$s =~ s/\+([^\/&\-]*)\/([^\/\-&]*)\-/\+$1,$2\-/g ;
$s =~ s/&/&\-/g ;
$s =~ s/\+([^+\-]+)?\-/&$1\-/g ;
return( $s ) ;
}