Ignore:
Timestamp:
2010-12-02T00:36:37+13:00 (13 years ago)
Author:
davidb
Message:

Further refinement of code to support HTML linking between documents when using non-ascii names on Windows

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/util.pm

    r23362 r23371  
    10301030    my ($filename,$within_dir) = @_;
    10311031   
    1032     my $dirsep = &util::get_dirsep();
    1033     if ($within_dir !~ m/$dirsep$/) {
     1032    if ($within_dir !~ m/[\/\\]$/) {
     1033    my $dirsep = &util::get_dirsep();
    10341034    $within_dir .= $dirsep;
    10351035    }
    10361036   
    10371037    $within_dir =~ s/\\/\\\\/g; # escape DOS style file separator
    1038    
     1038
    10391039    if ($filename =~ m/^$within_dir(.*)$/) {
    10401040    $filename = $1;
     
    10931093sub upgrade_if_dos_filename
    10941094{
    1095     my ($filename_full_path) = @_;
     1095    my ($filename_full_path,$and_encode) = @_;
    10961096
    10971097    if ($ENV{'GSDLOS'} =~ m/^windows$/i) {
     
    11021102    # Make sure initial drive letter is lower-case (to fit in with rest of Greenstone)
    11031103    $filename_full_path =~ s/^(.)/\l$1/;
     1104    if ((defined $and_encode) && ($and_encode)) {
     1105        $filename_full_path = encode("utf8",$filename_full_path);
     1106    }
    11041107    }
    11051108
Note: See TracChangeset for help on using the changeset viewer.