I am using the IDNA library to encode/decode unicide domain names but when I encode a domain name, it adds apostrophes either side of the string and prepends the letter b?
For example:
import idna
print(idna.encode('español.com'))
Output: b'xn--espaol-zwa.com'
Expected output: xn--espaol-zwa.com
I feel like I'm missing something really obvious but not sure how to get to the bottom of this.
My expected output is reinforced by the fact if I decode it:
print(idna.decode('xn--espaol-zwa.com'))
I get the original domain: español.com