stdinc: Drastically improve SDL_StepUTF8() and make it a public API.

Fixes #10105.
This commit is contained in:
Ryan C. Gordon
2024-06-26 21:32:45 -04:00
parent 9b8c5f642f
commit a9cfcf6bde
8 changed files with 211 additions and 58 deletions

View File

@@ -185,7 +185,7 @@ static char *CaseFoldUtf8String(const char *fname)
Uint32 codepoint;
char *ptr = retval;
size_t remaining = allocation;
while ((codepoint = SDL_StepUTF8(&fname, 4)) != 0) {
while ((codepoint = SDL_StepUTF8(&fname, NULL)) != 0) {
Uint32 folded[3];
const int num_folded = SDL_CaseFoldUnicode(codepoint, folded);
SDL_assert(num_folded > 0);