Better handle filename encoding mismatches