idn2_to_ascii_lz(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_ascii_lz(3) ✨

okay bestie, sit down, we're doing a libidn2 function from section 3 of the manual and it's lowkey iconic πŸ’…


🌸 NAME 🌸

idn2_to_ascii_lz β€” it's an API function, bestie. that's the whole name. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <idn2.h>

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

πŸ’– ARGUMENTS πŸ’–

  • const char * input β€” your zero terminated input UTF-8 string. the raw material, the moment, the vibe ✨
  • char ** output β€” a pointer to the newly allocated output string. yes, newly allocated, which means you gotta free it later, so don't forget or it's a leak era 😭
  • int flags β€” optional idn2_flags to modify behaviour. optional but powerful, yk?

πŸ‘‘ DESCRIPTION πŸ‘‘

so what this does is convert a domain name that's in the locale's encoding into an ASCII string, using the IDNA2008 rules. the domain name can have several labels in it, separated by dots. and fr fr, the output buffer must be deallocated by the caller β€” that's on you, not on the function. 🫢

The default behavior of this function (when flags are zero) is to apply the IDNA2008 rules without the TR46 amendments. But here's the tea: since TR46 non-transitional processing is nowadays ubiquitous, when you're unsure, it is recommended to call this function with the IDN2_NONTRANSITIONAL and the IDN2_NFC_INPUT flags for compatibility with other software. slay, compatibility. 🌈

ngl the "when unsure, pass those two flags" bit is the main character of this whole page. do with that what you will πŸ’œ

⭐ RETURNS ⭐

IDN2_OK on success, or an error code. it's the same as described in the idn2_lookup_ul() documentation, so if you need the full error lore, that's where it lives. πŸ“–


πŸŽ€ SINCE πŸŽ€

2.0.0 β€” she's been here a minute, periodt.


πŸ™ˆ REPORTING BUGS πŸ™ˆ

Found a bug? 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.


🌟 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/

and that's the whole page, bestie 🧚 this one's from libidn2, version 2.3.8, and yeah idn2_to_ascii_lz(3) is the girl. go forth and encode responsibly πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from