IvanMathy / Boop

A scriptable scratchpad for developers. In slow yet steady progress.
https://boop.okat.best
MIT License
3.84k stars 356 forks source link

Feature Request: Punycode URLs #376

Open benaltair opened 1 year ago

benaltair commented 1 year ago

It would be helpful to have encode and decode scripts for Punycode. This refers to domain names which have international characters, such as Chinese, Arabic, or accented Latin characters. Most browsers automatically convert Punycode to the represented characters in the URL bar.

Practically this means:

xn--rhta4012bbwc.live    ===    金山银山.live
     (encoded)                    (decoded)

The scripts would allow you to decode the example on the left, and see the output on the right.

benaltair commented 1 year ago

Something like the methods employed in this library could help speed things up perhaps: https://github.com/mathiasbynens/punycode.js

jk779 commented 12 months ago

I was just looking for this as well! <3

jk779 commented 12 months ago

Oh, I've just copy and pasted the library from the link and it works, you can try it out :)

https://gist.github.com/jk779/a37ed571aca7f7adab33b73caf5a22ae