idn2_to_unicode_8zlz(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_to_unicode_8zlz β€” bestie, we're decoding punycode πŸ’–

okay so real talk, you found yourself in the libidn2 manual (page idn2_to_unicode_8zlz(3), section 3, library functions, iykyk) and you're about to learn the single most iconic little function for turning weird xn---looking ACE domain names back into something a human can actually read. no cap. let's get into it ✨


🌸 NAME 🌸

idn2_to_unicode_8zlz β€” it's an API function, babe. that's the whole name. that's the vibe.


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <idn2.h>

int idn2_to_unicode_8zlz(const char * input, char ** output, int flags);

three args, one int back, extremely demure, extremely mindful πŸŽ€


✨ ARGUMENTS ✨

  • const char * input β€” your input string, and it's zero-terminated UTF-8. that's the requirement. respect it πŸ’…
  • char ** output β€” this is where the new output string goes. it's newly allocated and it comes out in the current locale's character set. so like, whatever your locale is feeling today, that's the encoding you get πŸ¦‹
  • int flags β€” currently unused. literally just sitting there. main character energy but no lines 😭

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea: this function takes a domain name that might be ACE encoded, sitting in UTF-8 format, and converts it into a string encoded in the current locale's character set. that conversion? that's punycode decoding. we're un-mangling it. we're giving it back its glow πŸ”₯

the output buffer is zero-terminated and β€” listen β€” it must be deallocated by the caller. that's on you. nobody's cleaning that up for you, bestie. free your memory. 🫢

also, tiny slay: output may be NULL if you just wanna test the lookup of input without allocating any memory at all. vibe check only, no commitment πŸ™ˆ

⭐ SINCE ⭐

2.0.0 β€” an elder. been here. iconic since day one πŸ‘‘


🌈 REPORTING BUGS 🌈

found a bug? don't suffer in silence, tell the people:


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. (yes that's the whole thing, verbatim, because legal text is not the place for creative liberties πŸ’€)


πŸ‘‘ 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, babe 🫢 this was libidn2 version 2.3.8, page idn2_to_unicode_8zlz(3), brought to you by the fine folks maintaining libidn2 β€” go decode something, you ate πŸ’…πŸ’–

πŸ“¦ where this page comes from