Tweak encodings to make sure they are stable and URL-safe