One of the important problems here is that file names are not in general encoded with the coding system indicated by the invoking user's environment variables.
In fact, two consecutive path elements (I.e. a directory name and its child's name) may use entirely incompatible character encoding systems.
