Handling charsets & whitespace when looking up extensions