idna(n)

πŸ“¦
version 9.0.3 Β· 2 versions
, in alpine 3.23, alpine 3.24, fedora 43, fedora 44, nixos 26.05

πŸ’– idna(n) β€” the manual, but make it make sense ✨

okay bestie, pull up a chair 🫢 this is idna, a Tcl Bundled Package, and it's literally the thing that makes internationalized domain names work. no cap.


✨ NAME ✨

tcl::idna β€” Support for normalization of Internationalized Domain Names


🌸 SYNOPSIS 🌸

package require tcl::idna 1.0

tcl::idna decode hostname
tcl::idna encode hostname
tcl::idna puny decode string ?case?
tcl::idna puny encode string ?case?
tcl::idna version

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically this package is a whole implementation of the punycode scheme β€” the one they use for Internationalised Domain Names β€” plus a couple of little access commands so you can actually talk to it. if you want the full lore, it's described in RFC 3492. iykyk πŸ’…

πŸ‘‘ tcl::idna decode hostname

this one takes the name of a host that might contain punycode-encoded character sequences, hostname, and gives you back the hostname as it might be displayed to the user. so like, the pretty version ✨

⚠️ real talk though: there are often UNICODE characters that have extremely similar glyphs, so be careful when you're displaying hostnames to users. a scammy lookalike is not the vibe. 🚩

πŸ‘‘ tcl::idna encode hostname

the other direction, bestie. you hand it the name of a host as it might be displayed to the user, hostname, and it returns the version of that hostname where all the characters that aren't permitted in basic hostnames get encoded with punycode. πŸŽ€

πŸ‘‘ tcl::idna puny subcommand ...

this is the direct line to the basic punycode encoder and decoder. no middleman, just vibes. it supports two subcommands:

🌈 tcl::idna puny decode string ?case?

decodes the punycode-encoded string and returns the result. now about that optional case β€” it's a boolean, and it controls whether the case gets folded during the decoding process: to upper case if case is true, or to lower case if case is false. if you just... don't pass it? then no case transformation happens at all. periodt.

🌈 tcl::idna puny encode string ?case?

encodes string and returns the punycode-encoded version of it. same deal with case: it's a boolean, and it folds the case during the encoding process to upper case if case is true and to lower case if case is false. omit it and, once again, no case transformation is applied. πŸ’–

πŸ‘‘ tcl::idna version

returns the version of the tcl::idna package. that's it. that's the whole command. iconic honestly. ⭐


πŸ“ EXAMPLE πŸ“

here's how the punycoding of a string works, watch this:

package require tcl::idna

puts [tcl::idna puny encode "abc→def"]
#    prints: abcdef-kn2c
puts [tcl::idna puny decode "abcdef-kn2c"]
#    prints: abc→def

the way it just round-trips 😭✨ obsessed.


🧚 SEE ALSO 🧚


πŸ’œ KEYWORDS πŸ’œ

  • internet
  • www

and that's the whole page, bestie 🫢 this one comes to you from http, version 0.1, dated idna(n) β€” go forth and punycode responsibly πŸ’…πŸŒˆπŸŽ€

πŸ“¦ where this page comes from