SDL_strcasecmp(3)
π SDL_strcasecmp π
okay bestie, welcome to the SDL_strcasecmp(3) page, straight outta the SDL3 FUNCTIONS manual, no cap β¨
πΈ NAME πΈ
SDL_strcasecmp β compare two null-terminated UTF-8 strings, case-insensitively. yeah, case does NOT matter here, we're all equals π
β¨ SYNOPSIS β¨
#include <SDL3/SDL_stdinc.h>
int SDL_strcasecmp(const char *str1, const char *str2);
π¦ DESCRIPTION π¦
so like, this one actually works with Unicode strings, using a technique called "case-folding" to handle the vast majority of case-sensitive human languages regardless of system locale. periodt. it doesn't care what your locale is set to, it just knows. main character energy fr fr π
and the way that it can deal with expanding values?? iconic. a German Eszett character can compare against two ASCII 's' chars and be considered a match, for example. ate. π
but ngl, there's a notable exception: it does not handle the Turkish 'i' character. human language is complicated, bestie, we can't fix everything π
since this handles Unicode, it expects the string to be well-formed UTF-8 and not a null-terminated string of arbitrary bytes. so heads up: bytes that are not valid UTF-8 are treated as Unicode character U+FFFD (REPLACEMENT CHARACTER), which is to say two strings of random bits may turn out to match if they convert to the same amount of replacement characters. wild, i know π
π FUNCTION PARAMETERS π
str1β the first string to compare.NULLis not permitted! πstr2β the second string to compare.NULLis not permitted! π
π RETURN VALUE π
- returns less than zero if
str1is "less than"str2 - returns greater than zero if
str1is "greater than"str2 - returns zero if the strings match exactly π«Ά
β THREAD SAFETY β
it is safe to call this function from any thread. go off, queen, call it everywhere πβ¨
π AVAILABILITY π
this function is available since SDL 3.2.0. so if you're on the old stuffβ¦ upgrade bestie π
Simple Directmedia Layer Β· SDL 3.4.18 Β· SDL_strcasecmp(3) β mwah, that's the whole page, ily, go compare some strings case-insensitively ππ¦π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms