idn2_register_u8(3)

πŸ“¦
version 2.3.8 Β· 5 versions
, in alpine 3.23, alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– idn2_register_u8 β€” the libidn2 bestie that registers your domain labels ✨

okay so you're here because idn2_register_u8 from libidn2 is calling your name and you need the tea. buckle up, this one's a whole vibe but honestly it's so good once it clicks 🫢


✨ SYNOPSIS ✨

#include <idn2.h>

int idn2_register_u8(const uint8_t * ulabel, const uint8_t * alabel,
uint8_t ** insertname, int flags);

πŸŽ€ ARGUMENTS πŸŽ€

  • const uint8_t * ulabel β€” your input, a zero-terminated UTF-8 and Unicode NFC string, or NULL. no cap, the NFC thing matters, we'll get to it πŸ’…
  • const uint8_t * alabel β€” your input, a zero-terminated ACE encoded string (you know, the xn-- girlies), or NULL.
  • uint8_t ** insertname β€” a freshly allocated output variable holding the name you're gonna register in DNS. it's giving main character, it's the whole point 🌟
  • int flags β€” optional idn2_flags to tweak the behaviour. ✨

🌸 DESCRIPTION 🌸

So what this actually does: it performs IDNA2008 register string conversion on the domain labels ulabel and alabel, exactly as described in section 4 of RFC 5891. and bestie, note this β€” the input ulabel must be encoded in UTF-8 and must be in Unicode NFC form. that's not a suggestion, that's the rule 😭

Wanna skip the manual NFC step? Pass IDN2_NFC_INPUT in flags and it'll convert the input ulabel to NFC form before doing any further processing. bless πŸ™

It is recommended that you supply both ulabel and alabel for better error checking, but supplying just one of them will work. and lowkey important: passing in only alabel is better than only ulabel. See RFC 5891 section 4 for more information. iykyk πŸ’œ

After version 0.11: insertname may be NULL to test conversion of src without allocating memory. cute, right? no malloc, no problem 🧚


πŸ”₯ RETURNS πŸ”₯

  • On successful conversion, IDN2_OK is returned πŸŽ‰
  • When the given ulabel and alabel do not match each other, IDN2_UALABEL_MISMATCH is returned 😬
  • When either of the input labels is too long, IDN2_TOO_BIG_LABEL is returned πŸ“
  • When alabel does not appear to be a proper A-label, IDN2_INVALID_ALABEL is returned πŸ’€
  • or, you know, another error code is returned. there's always a plot twist.

πŸ™ˆ REPORTING BUGS πŸ™ˆ

Found something cursed? Report bugs to help-libidn@gnu.org.

General guidelines for reporting bugs: https://www.gnu.org/gethelp/

Libidn2 home page: https://www.gnu.org/software/libidn2/


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. slay, that's actually generous πŸ’–


🌈 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, the 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/

ngl if you got this far you're literally an icon. go register that label bestie πŸ’…

mwah πŸ’‹ β€” this was page idn2_register_u8(3) from libidn2 version 2.3.8, and yes she ate, no crumbs left, periodt ✨

πŸ“¦ where this page comes from