idn_checkname(3)

πŸ“¦ version 2.3, in nixos 26.05, nixpkgs unstable

🌸 NAME 🌸

okay bestie, so this whole page is idn_checkname(3), straight from the Library Functions Manual β€” and it's literally the function that validates an internationalized domain name. it's giving β€œis this domain name valid or not, bestie?” energy πŸ’…βœ¨

✨ SYNOPSIS ✨

#include <idn/api.h>

idn_result_t
idn_checkname(idn_action_t actions, const char *from);

πŸ’– DESCRIPTION πŸ’–

so idn_checkname() lowkey does the thing: internally it creates a copy of name, encodes that copy with idn_encodename(), and returns its error code. periodt. 🫢

and on top of the action macros for idn_encodename() β€” like IDN_UNICODECONV β€” the following macros are available just for idn_checkname():

  • IDN_CHECK_REGIST β€” encodes a domain name with the IDNA2008 registration protocol to validate a domain name. currently, its value is the same as IDN_ENCODE_REGIST. πŸ‘‘
  • IDN_CHECK_LOOKUP β€” encodes a domain name with the IDNA2008 lookup protocol to validate a domain name. currently, its value is the same as IDN_ENCODE_LOOKUP. πŸ¦‹

πŸŽ€ EXAMPLES πŸŽ€

the program below is literally an example of idn_checkname() in action:

idn_result_t r;
...
r = idn_checkname(IDN_CHECK_REGIST, name);
if (r == idn_success)
    fprintf(stderr, "'%s' is valid\n", name);
else {
    fprintf(stderr, "'%s' is not valid: %s\n",
         name, idn_result_tostring(r));
}
...

🌈 SEE ALSO 🌈

go check out these icons too, bestie:


xoxo, bestie πŸ’‹ β€” that was idn_checkname(3) from the Library Functions Manual, dated Sep 21, 2012. mwah, slay, bye βœ¨πŸ’–

πŸ“¦ where this page comes from
  • nixos 26.05: idnkit 2.3
  • nixpkgs unstable: idnkit 2.3
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms