# Author: Alexander Moisseev # from the maillist backuppc-devel@lists.sourceforge.net # 2011-05-25 diff -ruN BackupPC-3.2.1.orig/bin/BackupPC_zipCreate BackupPC-3.2.1/bin/BackupPC_zipCreate --- BackupPC-3.2.1.orig/bin/BackupPC_zipCreate Mon Apr 25 07:31:55 2011 +++ BackupPC-3.2.1/bin/BackupPC_zipCreate Tue May 24 15:53:11 2011 @@ -21,7 +21,7 @@ # -r pathRemove path prefix that will be replaced with pathAdd # -p pathAdd new path prefix # -c level compression level (default is 0, no compression) -# -e charset charset for encoding file names (default: cp1252) +# -e charset charset for encoding file names (default: utf8) # # The -h, -n and -s options specify which dump is used to generate # the zip archive. The -r and -p options can be used to relocate @@ -93,7 +93,7 @@ -r pathRemove path prefix that will be replaced with pathAdd -p pathAdd new path prefix -c level compression level (default is 0, no compression) - -e charset charset for encoding file names (default: cp1252) + -e charset charset for encoding file names (default: utf8) EOF exit(1); } @@ -135,7 +135,7 @@ exit(1); } -my $Charset = "cp1252"; +my $Charset = ""; # default: utf8 $Charset = $opts{e} if ( $opts{e} ne "" ); my $PathRemove = $1 if ( $opts{r} =~ /(.+)/ ); @@ -310,6 +310,14 @@ # Specify the compression level for this member $zipmember->desiredCompressionLevel($compLevel) if ($compLevel =~ /[0-9]/); + + if ( $Charset =~ /^(?:utf[-_]?8)?$/i ) { + # Set general purpose bit 11 for UTF-8 code page + $zipmember->{bitFlag} = $zipmember->{bitFlag} | 0x0800 ; + } elsif ( $Charset =~ /^cp(?:437|720|737|775|85[02578]|86[069]|874|93[26]|949|950)$/i ) { + # Set "version made by" field to 0 (MS-DOS) for OEM code pages + $zipmember->fileAttributeFormat('FA_MSDOS'); + } # Finally Zip the member $zipfh->addMember($zipmember); diff -ruN BackupPC-3.2.1.orig/doc/BackupPC.html BackupPC-3.2.1/doc/BackupPC.html --- BackupPC-3.2.1.orig/doc/BackupPC.html Mon Apr 25 07:31:55 2011 +++ BackupPC-3.2.1/doc/BackupPC.html Tue May 24 09:28:33 2011 @@ -1664,7 +1664,7 @@ -r pathRemove path prefix that will be replaced with pathAdd -p pathAdd new path prefix -c level compression level (default is 0, no compression) - -e charset charset for encoding file names (default: cp1252) + -e charset charset for encoding file names (default: utf8)

The command-line files and directories are relative to the specified shareName. The zip file is written to stdout. The -h, -n and -s options specify which dump is used to generate the zip archive. The diff -ruN BackupPC-3.2.1.orig/doc/BackupPC.pod BackupPC-3.2.1/doc/BackupPC.pod --- BackupPC-3.2.1.orig/doc/BackupPC.pod Mon Apr 25 07:31:55 2011 +++ BackupPC-3.2.1/doc/BackupPC.pod Tue May 24 09:28:05 2011 @@ -1729,7 +1729,7 @@ -r pathRemove path prefix that will be replaced with pathAdd -p pathAdd new path prefix -c level compression level (default is 0, no compression) - -e charset charset for encoding file names (default: cp1252) + -e charset charset for encoding file names (default: utf8) The command-line files and directories are relative to the specified shareName. The zip file is written to stdout. The -h, -n and -s