in reply to Something to do with text encoding?

One issue I see with your code is that you're not quotemeta-ing $local_dir in

$fileName =~ s{$local_dir(.+)}{\.$1};

To be safe you should quote the meta characters in $local_dir with either quotemeta or the \Q and \E escapes:

$fileName =~ s{\Q$local_dir\E(.+)}{\.$1};

It is possible that it could be a filename encoding issue (a quick google search suggests that MacOS uses Unicode for file paths.) Can you determine what code-point (i.e. character ordinal) the apostrophe is in your file names? It possibly could be a non-ASCII character.

Replies are listed 'Best First'.
Re^2: Something to do with text encoding?
by russelj9 (Initiate) on Feb 13, 2008 at 18:43 UTC

    Well I got it fixed by doing this:

    $localData{$fileName} = file_md5_hex(decode('UTF-8', $File::Find::name +));

    I didn't know about the quotemeta so I'm glad to know. Though if I passed a quotemeta to file_md5_hex it still couldn't find the file.

    I still have problems when I try to put the file on the remote server but I'll make another post for that

Re^2: Something to do with text encoding?
by russelj9 (Initiate) on Feb 13, 2008 at 17:10 UTC

    Good to know thanks.