idn2_to_ascii_8z(3)
β¨ idn2_to_ascii_8z(3) β libidn2 β¨
okay bestie, pull up a chair because today we're talking about idn2_to_ascii_8z, one of the cutest little API functions in the whole libidn2 manual π it lives in section 3 (that's the library-functions section, iykyk) and it is literally here to turn your pretty Unicode domain name into boring-but-necessary ASCII. the way that internationalization works?? iconic. periodt.
πΈ NAME πΈ
idn2_to_ascii_8z β it's an API function, bestie. that's the whole vibe. β¨
π SYNOPSIS π
#include <idn2.h>
int idn2_to_ascii_8z(const char * input, char ** output, int flags);
yes she's a three-argument girlie and yes she returns an int. no cap. π
π¦ ARGUMENTS π¦
const char * inputβ this is your input, bb. it's a zero terminated input UTF-8 string. so like, null-terminated, UTF-8, the whole deal. don't come at her with anything else πchar ** outputβ a pointer to a newly allocated output string. notice the double star?? that's because she's gonna hand you back a fresh pointer. main character energy tbh πint flagsβ optionalidn2_flagsto modify behaviour. optional!! as in you can pass stuff here if you wanna switch things up π
π DESCRIPTION π
so here's the tea β this function converts a UTF-8 domain name to an ASCII string using the IDNA2008 rules. that's the whole point of her existence and she ate.
your domain name can contain several labels, separated by dots. so like δΎγ.γγΉγ vibes β multiple labels, dots in between, no problemo π
β οΈ important bestie: the output buffer must be deallocated by the caller. that means you free it. she allocates, you clean up. that's the deal, don't leave her hanging π
now, the default behavior β and this is the part everyone asks about β is that when flags are zero, she applies the IDNA2008 rules without the TR46 amendments. no TR46, no amendments, just pure IDNA2008.
but here's the thing π«Ά since TR46 non-transitional processing is nowadays ubiquitous, if you're unsure (and let's be honest, we're all unsure sometimes), it is recommended to call this function with the IDN2_NONTRANSITIONAL flag and the IDN2_NFC_INPUT flag, so you get compatibility with other software. two flags, one slay. do it for the interoperability π
β¨
Return value: returns IDN2_OK on success, or an error code. that's it. that's the return value. if you get IDN2_OK you're winning, anything else means something went sideways πΈ
β SINCE β
2.0.0 β she's been around since version 2.0.0, a true veteran of the game. respect the elders π
π REPORTING BUGS π
found a bug?? okay don't panic, here's what you do:
- Report bugs to
<help-libidn@gnu.org>β that's the email, copy it exactly bestie, no typos π§ - General guidelines for reporting bugs live at:
https://www.gnu.org/gethelp/β read these first so your bug report is chef's kiss π₯ - Libidn2 home page:
https://www.gnu.org/software/libidn2/β that's the homepage, go say hi π
π COPYRIGHT π
Copyright Β© 2002-2025 Simon Josefsson. π
and the licensing tea: copying and distribution of this file, with or without modification, are permitted in any medium without royalty β provided that the copyright notice and this notice are preserved. so like, go off, remix it, print it on a tote bag, whatever, just keep the notice intact. that's the rule πβ¨
π 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. bestie, that's the whole manual, right there, in your terminal π«Ά
as an alternative you may obtain the manual from:
https://www.gnu.org/software/libidn/libidn2/manual/
iykyk β bookmark it, it's useful π
and that's the page!! this was libidn2 version 2.3.8, from the idn2_to_ascii_8z(3) manual page β thanks for reading all the way to the end bestie, you're literally the best ππβ¨ mwah! π¦
π¦ where this page comes from
- alpine 3.23: libidn2-doc 2.3.8-r0 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- alpine 3.24: libidn2-doc 2.3.8-r0 Β· GPL-2.0-or-later OR LGPL-3.0-or-later
- arch rolling: libidn2 2.3.8-1 Β· GPL2 AND LGPL3
- debian trixie: libidn2-dev 2.3.8-2 Β· GPL-3.0-or-later
- fedora 43: libidn2-devel 2.3.8-2.fc43 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- fedora 43: libidn2-devel 2.3.8-2.fc43 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- fedora 44: libidn2-devel 2.3.8-3.fc44 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- fedora 44: libidn2-devel 2.3.8-3.fc44 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- opensuse-leap 16.0: libidn2-devel 2.3.8-160000.2.2 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- opensuse-leap 16.0: libidn2-devel 2.3.8-160000.2.2 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- opensuse-leap 16.0: libidn2-devel 2.3.8-160000.2.2 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- opensuse-leap 16.0: libidn2-devel 2.3.8-160000.2.2 Β· (GPL-2.0-or-later OR LGPL-3.0-or-later) AND GPL-3.0-or-later
- ubuntu questing: libidn2-dev 2.3.8-4
- ubuntu resolute: libidn2-dev 2.3.8-4build1 Β· GPL-3.0-or-later
- ubuntu stonking: libidn2-dev 2.3.8-5 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms