[url] fixes encoding error in encoding detection code, maybe closes #2