Okay, now this is at least starting to make some sense. Is there a library (in Perl or otherwise) that lets me deal with this mess? Ideally, I'd like to take those URLs, decode them, normalize them, see if the actual file matches the name and if not, normalize the other way, and then reencode.

Bonus question: if the file is "named" with one normal form and you ask for it with a different but equivalent normal form, should it open the file or not? Do different filesystems deal with this in different ways?