Only convert the result of XLookupString() if it's not already UTF-8

Fixes https://github.com/libsdl-org/SDL/issues/7766
This commit is contained in:
Sam Lantinga
2023-06-04 02:06:52 -07:00
parent c369b90019
commit 491ae20d96
3 changed files with 43 additions and 3 deletions

View File

@@ -26,6 +26,9 @@
/* Common utility functions that aren't in the public API */
/* Return the smallest power of 2 greater than or equal to 'x' */
int SDL_powerof2(int x);
extern int SDL_powerof2(int x);
/* Return whether the string is valid UTF8 */
extern SDL_bool SDL_utf8valid(const char *str, size_t bytes);
#endif /* SDL_utils_h_ */