Fix encoding problems in url normalization

It should fix what I broke.