Fix an issue with filenames containing non-ASCII characters

Fix an issue with filenames containing non-ASCII characters that
lead to a failure setting the size of a files ressource fork.
This affected application like Adobe Photoshop where saving
files may fail. Fixes bug #511.