idn2_register_ul(3)
β¨ idn2_register_ul(3) β the libidn2 glow-up β¨
okay bestie, pull up a chair π«Ά this one lives in the libidn2 manual (that's the manual name, in case the header line was being mysterious), and it's literally the register-string-conversion girlie of the family. let's get into it π
πΈ NAME πΈ
idn2_register_ul β an API function, no cap. that's the whole name section, she's brief and she knows it β¨
π SYNOPSIS π
#include <idn2.h>
int idn2_register_ul(const char * ulabel, const char * alabel, char **
insertname, int flags);
π ARGUMENTS π
const char * ulabelβ the input zero-terminated locale-encoded string, orNULLif you're not about that life. πconst char * alabelβ the input zero-terminated ACE-encoded string (you know, thexn--ones), orNULL.char ** insertnameβ a newly allocated output variable holding the name you're gonna register in DNS. this is the whole point, she's the main character πint flagsβ optionalidn2_flagsto modify behaviour. little toggles, big vibes.
π¦ DESCRIPTION π¦
so what does she do? she performs IDNA2008 register string conversion on the domain labels ulabel and alabel, exactly as described in section 4 of RFC 5891. periodt.
heads up tho, and this is important: the input ulabel is assumed to be encoded in the locale's default coding system, and this function will transcode it to UTF-8 and NFC-normalize it for you. she's doing the work so you don't have to, icon behaviour fr fr β¨
it is recommended that you supply both ulabel and alabel for better error checking, but honestly supplying just one of them will work too. and if you're only gonna pass one? passing only alabel is better than only ulabel. see RFC 5891 section 4 for more information. iykyk π
π little history moment: after version 0.11,insertnamemay beNULLβ that lets you test the conversion ofsrcwithout allocating any memory. lowkey a whole mood.
β RETURNS β
she gives back a whole menu of possible outcomes, and you need to know them all:
IDN2_OKβ returned on successful conversion. slay, she ate πIDN2_UALABEL_MISMATCHβ returned when the givenulabelandalabeldo not match each other. they're beefing πIDN2_TOO_BIG_LABELβ returned when either of the input labels are too long. she's got a limit and she's not budging πIDN2_INVALID_ALABELβ returned whenalabeldoes does not appear to be a proper A-label. (that double "does does" is canon, i'm just the messenger π)IDN2_ICONV_FAILβ returned when theulabellocale-to-UTF-8 conversion failed. the transcode said nope π- or, you know, another error code is returned. there's a whole extended universe of them.
π REPORTING BUGS π
found a bug? don't suffer in silence, bestie. report it to:
help-libidn@gnu.org
general guidelines for reporting bugs live at:
https://www.gnu.org/gethelp/
and the Libidn2 home page is right here:
https://www.gnu.org/software/libidn2/
π COPYRIGHT π
Copyright Β© 2002-2025 Simon Josefsson.
copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. so go forth and share responsibly π«Ά
π SEE ALSO π
the full documentation for libidn2 is maintained as a Texinfo manual. if the info and libidn2 programs are properly installed at your site, this command:
info libidn2
should give you access to the complete manual. as an alternative you may obtain the manual from:
https://www.gnu.org/software/libidn/libidn2/manual/
and that's the whole page, bestie!! this was libidn2 version 2.3.8 doing the absolute most π
β¨ go forth, convert your labels, and remember: supply both ulabel and alabel for better error checking. mwah ππ¦π
π¦ where this page comes from
- alpine 3.23: libidn2-doc 2.3.8-r0 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- alpine 3.24: libidn2-doc 2.3.8-r0 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- arch rolling: libidn2 2.3.8-1 Β· GPL2 AND LGPL3
- debian trixie: libidn2-dev 2.3.8-2 Β· GPL-3.0-or-later
- fedora 43: libidn2-devel 2.3.8-2.fc43 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- fedora 43: libidn2-devel 2.3.8-2.fc43 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- fedora 44: libidn2-devel 2.3.8-3.fc44 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- fedora 44: libidn2-devel 2.3.8-3.fc44 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- opensuse-leap 16.0: libidn2-devel 2.3.8-160000.2.2 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- opensuse-leap 16.0: libidn2-devel 2.3.8-160000.2.2 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- opensuse-leap 16.0: libidn2-devel 2.3.8-160000.2.2 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- opensuse-leap 16.0: libidn2-devel 2.3.8-160000.2.2 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- ubuntu questing: libidn2-dev 2.3.8-4
- ubuntu resolute: libidn2-dev 2.3.8-4build1 Β· GPL-3.0-or-later
- ubuntu stonking: libidn2-dev 2.3.8-5 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms