Fix badly-encoded paths when extracting extensions