stringprep_strerror(3)

πŸ’– stringprep_strerror β€” bestie edition πŸ’–

okay so this one's a libidn function, and it lives in the stringprep_strerror(3) manual page, and honestly? it's giving "translator for your error codes." no cap. πŸ¦‹


✨ NAME ✨

stringprep_strerror β€” the API function that turns your sad little return code into actual words πŸ’…


✨ SYNOPSIS ✨

#include <stringprep.h>

const char * stringprep_strerror(Stringprep_rc rc);

✨ ARGUMENTS ✨

  • Stringprep_rc rc β€” literally just a Stringprep_rc return code. that's the whole thing she wants from you 🫢

✨ DESCRIPTION ✨

so what she does is take a return code integer and convert it into a text string, bestie. and that string? you can use it to print a diagnostic message to the user. iconic behaviour, truly. ✨


🌸 STRINGPREP_OK

Successful operation. and listen β€” this value is guaranteed to always be zero. the rest of them are only guaranteed to hold non-zero values, and that's purely for logical comparison purposes. iykyk. πŸ’–

🌸 STRINGPREP_CONTAINS_UNASSIGNED

the string contains unassigned Unicode code points, which the profile literally forbids. not allowed. periodt. 🚫

🌸 STRINGPREP_CONTAINS_PROHIBITED

the string contains code points that the profile prohibits. yeah. she said no. πŸ’€

🌸 STRINGPREP_BIDI_BOTH_L_AND_RAL

the string contains code points with conflicting bidirection category. they're fighting, bestie 😭

🌸 STRINGPREP_BIDI_LEADTRAIL_NOT_RAL

the leading and trailing character in the string are not of the proper bidirectional category. not the right vibe, sadly πŸŽ€

🌸 STRINGPREP_BIDI_CONTAINS_PROHIBITED

contains prohibited code points, detected by bidirectional code. caught in 4k πŸ”₯

🌸 STRINGPREP_TOO_SMALL_BUFFER

the buffer handed to the function was too small. and this usually indicates a problem in the calling application, so… not her fault, fr fr πŸ™ˆ

🌸 STRINGPREP_PROFILE_ERROR

the stringprep profile was inconsistent. this usually indicates an internal error in the library. rare, but real.

🌸 STRINGPREP_FLAG_ERROR

the supplied flag conflicted with the profile. this usually indicates a problem in the calling application β€” yeah, that's a you problem bestie 😌

🌸 STRINGPREP_UNKNOWN_PROFILE

the supplied profile name was not known to the library. she doesn't know her. never met her. πŸ’€

🌸 STRINGPREP_ICONV_ERROR

character encoding conversion error. the conversion simply did not slay 😭

🌸 STRINGPREP_NFKC_FAILED

the Unicode NFKC operation failed. this usually indicates an internal error in the library. nfkc said "not today" 🧚

🌸 STRINGPREP_MALLOC_ERROR

the malloc() was out of memory. and heads up β€” this is usually a fatal error. like, for real for real. 🚨


⭐ Return value ⭐

returns a pointer to a statically allocated string containing a description of the error with the return code rc. so don't go freeing her, she's not yours πŸ’œ


😀 REPORTING BUGS 😀

found a bug? tell the people:


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. slay, and also legally binding, but mostly slay ✨


🌈 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. and as an alternative you may obtain the manual from:

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

🫢 friendly reminder: she returns a statically allocated string, so don't try to free it and don't try to modify it. just read it and move on, bestie. πŸ’–

and that's the whole page!! brought to you by libidn, version 1.44, from the stringprep_strerror(3) manual page β€” mwah, go forth and print your diagnostics, main character πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from