···24722472/**
24732473 * The Unicode REPLACEMENT CHARACTER codepoint.
24742474 *
24752475- * SDL_StepUTF8() reports this codepoint when it encounters a UTF-8 string
24752475+ * SDL_StepUTF8() and SDL_StepBackUTF8() report this codepoint when they encounter a UTF-8 string
24762476 * with encoding errors.
24772477 *
24782478 * This tends to render as something like a question mark in most places.
24792479 *
24802480 * \since This macro is available since SDL 3.0.0.
24812481 *
24822482+ * \sa SDL_StepBackUTF8
24822483 * \sa SDL_StepUTF8
24832484 */
24842485#define SDL_INVALID_UNICODE_CODEPOINT 0xFFFD
···25272528 * \since This function is available since SDL 3.0.0.
25282529 */
25292530extern SDL_DECLSPEC Uint32 SDLCALL SDL_StepUTF8(const char **pstr, size_t *pslen);
25312531+25322532+/**
25332533+ * Decode a UTF-8 string in reverse, one Unicode codepoint at a time.
25342534+ *
25352535+ * This will go to the start of the previous Unicode codepoint in the string, move `*pstr` to that location and return that codepoint.
25362536+ *
25372537+ * If the resulting codepoint is zero (already at the start of the string), it will not advance `*pstr` at all.
25382538+ *
25392539+ * Generally this function is called in a loop until it returns zero,
25402540+ * adjusting its parameter each iteration.
25412541+ *
25422542+ * If an invalid UTF-8 sequence is encountered, this function returns
25432543+ * SDL_INVALID_UNICODE_CODEPOINT.
25442544+ *
25452545+ * Several things can generate invalid UTF-8 sequences, including overlong
25462546+ * encodings, the use of UTF-16 surrogate values, and truncated data. Please
25472547+ * refer to
25482548+ * [RFC3629](https://www.ietf.org/rfc/rfc3629.txt)
25492549+ * for details.
25502550+ *
25512551+ * \param start a pointer to the beginning of the UTF-8 string.
25522552+ * \param pstr a pointer to a UTF-8 string pointer to be read and adjusted.
25532553+ * \returns the previous Unicode codepoint in the string.
25542554+ *
25552555+ * \threadsafety It is safe to call this function from any thread.
25562556+ *
25572557+ * \since This function is available since SDL 3.0.0.
25582558+ */
25592559+extern SDL_DECLSPEC Uint32 SDLCALL SDL_StepBackUTF8(const char *start, const char **pstr);
2530256025312561/**
25322562 * Convert a single Unicode codepoint to UTF-8.