mirror of
https://github.com/imapsync/imapsync.git
synced 2025-07-25 03:28:16 +02:00
1.727
This commit is contained in:
parent
3eaac56812
commit
137242e609
114 changed files with 10852 additions and 8980 deletions
21
W/learn/utf7_to_utf7imap
Executable file
21
W/learn/utf7_to_utf7imap
Executable 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 ) ;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue