DEV Community

Discussion on: I just bought 👩‍💻👨‍💻.to!

Collapse
 
lionelrowe profile image
lionel-rowe • Edited

Ah I see. The first half makes sense, but the combining characters are themselves Unicode characters ([...'👩‍💻'].length === 3), so it's not just something in how Unicode itself is decoded. It must be something in the punycode spec that states that invisible characters are simply ignored. I just checked and it seems this is the case:

new URL('https://👩💻👨💻.to').href
=== new URL('https://👩‍💻👨‍💻.to').href
// true
Enter fullscreen mode Exit fullscreen mode

Pretty interesting!

Edit: Actually, it might just be Chromium's implementation, rather than the spec itself. In Firefox, new URL('https://👩💻👨💻.to').href is xn--qq8hb0wb.to/, whereas new URL('https://👩‍💻👨‍💻.to').href is xn--1uga01807aca52bc.to/ (a domain name that doesn't resolve). Sure enough, opening 👩‍💻👨‍💻.to doesn't work in Firefox (but 👩💻👨💻.to works fine).

Thread Thread
 
grahamthedev profile image
GrahamTheDev

Yeah it is something I should actually learn properly as the amount of times I get confused between &X2394; and U+212C etc. as ways of encoding emojis is quite embarrassing (as was that sentence probably as like I said, I don't understand it all properly 🤣)!

And punycode was the term I couldn't remember so thanks for that!

Thread Thread
 
patarapolw profile image
Pacharapol Withayasakpunt

It will be converted to punycode, anyway.