idn2_lookup_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_lookup_u8 β€” a.k.a. the libidn2 API function πŸ’–

okay bestie, sit DOWN, because this one is literally the main character of IDNA2008 lookups. it's <cyan>idn2_lookup_u8</cyan> from the libidn2 manual, and yes, she ate. πŸ“


✨ SYNOPSIS ✨

#include <idn2.h>

int idn2_lookup_u8(const uint8_t * src, uint8_t ** lookupname, int
flags);

that's it, that's the whole vibe. one function, three little arguments, infinite slay. πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • const uint8_t * src β€” your input, bestie! it's a zero-terminated UTF-8 string, and it must be in Unicode NFC normalized form. no cap, if it's not NFC you're gonna have a bad time. 😭
  • uint8_t ** lookupname β€” the output variable, freshly allocated by the function, holding the name you're gonna look up in DNS. so it's giving "here's your glow-up result" energy. πŸ‘‘
  • int flags β€” optional idn2_flags to modify the behaviour. this is where you customize the whole situation. πŸ¦‹

🌈 DESCRIPTION 🌈

So what does she actually do? She performs the IDNA2008 lookup string conversion on the domain name src, exactly as described in section 5 of RFC 5891. iconic behavior, honestly. πŸ“œβœ¨

heads up bestie: the input string must be encoded in UTF-8 and be in Unicode NFC form. both. no exceptions. that's the vibe check.

Pass IDN2_NFC_INPUT in flags to convert the input to NFC form before further processing. and listen β€” IDN2_TRANSITIONAL and IDN2_NONTRANSITIONAL already imply IDN2_NFC_INPUT, so no need to double up, she's got you. 🫢

Pass IDN2_ALABEL_ROUNDTRIP in flags to convert any input A-labels to U-labels and perform additional testing. and get this β€” this is default since version 2.2. to switch this behavior off, you pass IDN2_NO_ALABEL_ROUNDTRIP. yes, it's the "not me flipping the default" situation. πŸ’€

Pass IDN2_TRANSITIONAL to enable Unicode TR46 transitional processing, and IDN2_NONTRANSITIONAL to enable Unicode TR46 non-transitional processing. pick your fighter. πŸ₯Š

Multiple flags may be specified by binary or:ing them together. stack 'em like bracelets. 🌸

After version 2.0.3: IDN2_USE_STD3_ASCII_RULES is disabled by default. previously we were eliminating non-STD3 characters from domain strings such as _443._tcp.example.com, or IPs like 1.2.3.4/24 provided to libidn2 functions. that was an unexpected regression for applications switching from libidn, and thus it is no longer applied by default. 😀 Use IDN2_USE_STD3_ASCII_RULES to enable that behavior again, if that's your thing.

After version 0.11: lookupname may be NULL to test lookup of src without allocating memory. a little dry-run moment, we love to see it. 🧚


⭐ RETURNS ⭐

On successful conversion, IDN2_OK is returned. πŸŽ‰

If the output domain or any label would have been too long, IDN2_TOO_BIG_DOMAIN or IDN2_TOO_BIG_LABEL is returned β€” she's too big to fit, it's giving oversized luggage at the airport. 🧳

Or, you know, another error code is returned. just read the error, bestie. πŸ™ˆ


πŸ¦‹ SINCE πŸ¦‹

0.1 β€” she's been here since the beginning. a true OG. πŸ‘‘


πŸ’œ REPORTING BUGS πŸ’œ

Found a bug? don't gatekeep, report it to <help-libidn@gnu.org>. πŸ“§

General guidelines for reporting bugs live at: 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. periodt. πŸ’…


πŸ”₯ 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. iykyk. πŸ“–βœ¨

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, and yeah, we're deep in the idn2_lookup_u8(3) era. go forth and normalize those strings. mwah. πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from