gsasl_stringprep_nfkc(3)

πŸ“¦ version 1.10.0, in ubuntu jammy

πŸ’– gsasl_stringprep_nfkc β€” bestie, we're normalizing πŸ’…

okay so real talk, this is a page from the GNU SASL manual, and the function in question is gsasl_stringprep_nfkc(3). she's an API function. and bestie… she's deprecated, but we'll get to that. sit down, hydrate, we're doing Unicode today πŸ¦‹


✨ SYNOPSIS ✨

#include <gsasl.h>

char * gsasl_stringprep_nfkc(const char * in, ssize_t len);

πŸŽ€ ARGUMENTS πŸŽ€

  • const char * in β€” a UTF-8 encoded string. that's the thing you're feeding her.
  • ssize_t len β€” the length of str, in bytes. or, and this is the cute part, -1 if str is nul-terminated. she'll figure out the end herself, main character energy 🫢

🌸 DESCRIPTION 🌸

she converts a string into canonical form. what does that even mean. okay so imagine one character with an accent β€” it could be written as a base character plus a combining accent, OR as one single precomposed character. same vibe, different bytes. this function standardizes all that drama. ✨

the normalization mode is NFKC β€” that's ALL COMPOSE btw. it standardizes differences that don't affect the text content, like the accent representation situation we just talked about. it also standardizes the "compatibility" characters in Unicode, like SUPERSCRIPT THREE becoming the standard forms (in this case DIGIT THREE). and yes, formatting information may be lost 😭 but for most text operations those characters should be considered the same anyway. and it returns a result with composed forms rather than a maximally decomposed form. so she composes. she's a composer. πŸŽ€

Return value: she returns a newly allocated string that is the NFKC normalized form of str, or NULL on error. NULL is the villain arc, avoid it. πŸ’€

πŸ’€ DEPRECATED πŸ’€

okay. deep breath. she's deprecated. 😭

there's no replacement functionality in GNU SASL β€” instead, use GNU Libidn. and listen, this is the important bit, in SASL you most likely want to use SASLprep and not bare NFKC. see gsasl_saslprep(). so like, do that instead. periodt. πŸ’…


πŸ› REPORTING BUGS πŸ›

found a bug? bestie, tell the devs, they want to know, no gatekeeping:


Copyright Β© 2002-2021 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. (iconic of them honestly, we love a permissive license 🫢)


🌈 SEE ALSO 🌈

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

info gsasl

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

http://www.gnu.org/software/gsasl/manual/

iykyk πŸ“šβœ¨


and that's the whole page bestie, we ate and left no crumbs πŸ“ this was gsasl version 1.10.0, page gsasl_stringprep_nfkc(3), and yeah she's deprecated so go use gsasl_saslprep() instead, mwah πŸ’œπŸ§š

πŸ“¦ where this page comes from