pr29_8z(3)

πŸ’– pr29_8z πŸ’–

okay bestie, so this one is pr29_8z, and it lives in the libidn manual, section 3 (that's the "C library functions" section, iykyk). it's a lil detective function that sniffs your UTF-8 string and tells you if it's about to get misunderstood by the NFKC girlies. buckle up πŸŽ€


✨ SYNOPSIS ✨

#include <pr29.h>

int pr29_8z(const char * in);

literally that's it. one include, one function call, no drama. 🌸


πŸ¦‹ ARGUMENTS πŸ¦‹

  • const char * in β€” your zero terminated input UTF-8 string, bestie. zero terminated meaning it ends with that lil \0 vibe so the function knows when to stop reading. don't forget the terminator, it's giving main character energy and it matters. πŸ’…

πŸ‘‘ DESCRIPTION πŸ‘‘

so the whole point of this function is a vibe check on your string. it checks the input to see if it may be normalized into different strings by different NFKC implementations, because of an anomaly in the NFKC specifications. like, the spec itself has a lil glitch, and this function exists purely to catch it. not me being obsessed with a spec bug 😭

Return value: it hands you back a Pr29_rc value, and here's the tea on what each one means:

  • PR29_SUCCESS β€” slay! everything's fine, the input is chill, we move on. ✨
  • PR29_PROBLEM β€” uh oh. the input sequence is a "problem sequence", meaning it may be normalized into different strings by different implementations. that's the whole reason this function exists, so if you get this, take it seriously fr fr. 🚨
  • PR29_STRINGPREP_ERROR β€” something went wrong converting the string from UTF-8 to UCS-4. so like, the string never even made it to the actual check. it's not a normalization problem, it's a "we couldn't even read this" problem. πŸ’€
lowkey important: PR29_PROBLEM is not the same as an error. it's a legitimate result saying "hey, different NFKC implementations might disagree about this one." PR29_STRINGPREP_ERROR is the actual failure. don't mix them up bestie πŸ™ˆ

🌈 REPORTING BUGS 🌈

found a bug? spill the tea, don't suffer in silence:


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.

(yes that means you can share it around, just keep the notice. we love a permissive license moment 🫢)


πŸ’œ SEE ALSO πŸ’œ

the full documentation for libidn is maintained as a Texinfo manual, and if the info and libidn programs are properly installed at your site, this command:

info libidn

should give you access to the complete manual. if that's not giving, you can also just grab the manual from:

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

okay that's the whole page, bestie. go normalize something responsibly. πŸ’–βœ¨πŸŒΈπŸ¦‹πŸ’…

libidn, version 1.44 β€” mwah, sending you a kiss from the pr29_8z(3) page πŸ’‹

πŸ“¦ where this page comes from