Use equivalence instead of strict equality for path components.
Avoid calling charset::convert() if no conversion is needed.