GRAPHEME_TO_LOWERCASE_UTF8(3)
π GRAPHEME_TO_LOWERCASE_UTF8(3) π
okay so bestie, this one lives in the Library Functions Manual, section 3, and the whole personality is grapheme_to_lowercase_utf8 β yes the header up there is a lil truncated (GRAPHEME_TO_LOWERCASE_UT) but we know her π
β¨ NAME β¨
grapheme_to_lowercase_utf8 β convert a UTF-8-encoded string to lowercase, no cap π«Ά
πΈ SYNOPSIS πΈ
#include <grapheme.h>
size_t
grapheme_to_lowercase_utf8(const char *src, size_t srclen, char *dest,
size_t destlen);
π¦ DESCRIPTION π¦
so the grapheme_to_lowercase_utf8() function converts the UTF-8-encoded string str to lowercase and writes the result into dest, up to destlen β unless dest is set to NULL, in which case she's just doing the math, not the writing π
if srclen is set to SIZE_MAX (and yes, stdint.h is already included by grapheme.h, so you don't gotta do anything π
), then the UTF-8-encoded string src is interpreted as being NUL-terminated, and processing stops the moment a NUL-byte is encountered. iconic behavior honestly.
for non-UTF-8 input data, grapheme_to_lowercase(3) can be used instead β she's the sibling for that β¨
β RETURN VALUES β
grapheme_to_lowercase_utf8() returns the number of bytes in the array that results from converting src to lowercase β and she returns that number even if destlen is not large enough or dest is NULL. like she always tells you how much space you would've needed, no gatekeeping π₯
π SEE ALSO π
π STANDARDS π
grapheme_to_lowercase_utf8() is compliant with the Unicode 17.0.0 specification. periodt. π
π AUTHORS π
Laslo Hunhold <dev@frign.de> β thank you for your service π«Ά
ngl if you're passing a destlen that's too small, she's still gonna tell you the real size, so vibe check your buffers before you copy anything in, bestie π
written with love by the lovely humans at suckless.org, dated 2022-10-06, and this whole page is literally GRAPHEME_TO_LOWERCASE_UTF8(3) β mwah, bye bestie ππ§ββοΈ
π¦ where this page comes from
- nixos 26.05: libgrapheme 3.0.0
- nixpkgs unstable: libgrapheme 3.0.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms