idna_to_ascii_8z(3)

✨ idna_to_ascii_8z(3) ✨

okay so bestie, we're in the libidn corner of your manual and this one is literally the glow-up function. it's an API function, and it's the one that takes your cute lil' UTF-8 domain name and turns it into that ASCII baddie. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <idna.h>

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

πŸŽ€ ARGUMENTS πŸŽ€

  • const char * input β€” the zero terminated input UTF-8 string, aka your domain name before the makeover. it's a const char * so like, hands off, we're just reading her. 🫢
  • char ** output β€” a pointer to the newly allocated output string. yes bestie, newly allocated, which means somebody has to free it and that somebody is you. 😭
  • int flags β€” an Idna_flags value, like for example IDNA_ALLOW_UNASSIGNED or IDNA_USE_STD3_ASCII_RULES. pick your vibe, these are the knobs you get to twist. ✨

πŸ’– DESCRIPTION πŸ’–

Convert a UTF-8 domain name to an ASCII string. that's it, that's the whole serve. πŸ‘‘

the domain name may contain several labels, separated by dots β€” so like, www.example.com energy, multiple little segments all doing their thing, and this function handles the whole fit. 🌈

🚨 not me forgetting the most important part: the output buffer must be deallocated by the caller. that's you. the caller. you have to free it. this is not a drill, this is a memory leak waiting to happen if you ghost it. πŸ’€

Return value: Returns IDNA_SUCCESS on success, or an error code. so like, check it. if it's not IDNA_SUCCESS, something went wrong and you should probably look at it instead of pretending you didn't see it. πŸ™ˆ


πŸ”₯ REPORTING BUGS πŸ”₯

found a bug? don't be shy, tell the libidn girlies:


Copyright Β© 2002-2026 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 like, yes you can share it, just keep the receipts bestie, keep the copyright notice and this notice exactly where they are. periodt. πŸ’œ)


🌸 SEE ALSO 🌸

The full documentation for libidn is maintained as a Texinfo manual. If the info and libidn programs are properly installed at your site, the command

info libidn

should give you access to the complete manual. As an alternative you may obtain the manual from:

https://www.gnu.org/software/libidn/manual/

and that's the whole page, bestie 🧚✨ this one's from libidn 1.44, dated idna_to_ascii_8z(3) β€” go forth and ASCII-ify responsibly, and for the love of everything, free() that output. πŸ’–

πŸ“¦ where this page comes from