Closed dkamanga-dot closed 1 month ago
Hello. Is there a reason why converting https://www.xn--b.com to Punycode would return null? Please see the code snippet below.
Welcome to Node.js v22.9.0. Type ".help" for more information. > const tr46 = require('tr46'); > tr46.toASCII("https://www.xn--b.com") null
I believe (haven't fully stepped through the code) that it's because b is not long enough to encode anything interesting in Punycode, so you get a decoding error (represented as null).
b
null
Hello. Is there a reason why converting https://www.xn--b.com to Punycode would return null? Please see the code snippet below.