Unified idna decoding across the codebase and fixed edge cases