idn_checkname(3)
πΈ 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 asIDN_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 asIDN_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
- Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved
- Copyright (c) 2000-2002 Japan Network Information Center. All rights reserved."
- Copyright (c) 2010-2012 Japan Registry Services Co., Ltd. All rights reserved."
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms