DOKK / manpages / debian 13 / libsdl3-doc / SDL_utf8strlcpy.3.en
SDL_utf8strlcpy(3) SDL3 FUNCTIONS SDL_utf8strlcpy(3)

SDL_utf8strlcpy - Copy an UTF-8 string.

Defined in SDL3/SDL_stdinc.h

#include "SDL3/SDL.h"
size_t SDL_utf8strlcpy(char *dst, const char *src, size_t dst_bytes);

This function copies up to dst_bytes

• 1 bytes from src to dst while also ensuring that the string written to dst does not end in a truncated multi-byte sequence. Finally, it appends a null terminator. src and dst must not overlap.

Note that unlike SDL_strlcpy (), this function returns the number of bytes written, not the length of src .

The destination buffer. Must not be NULL, and must not overlap with src .
The null-terminated UTF-8 string to copy. Must not be NULL, and must not overlap with dst .
The length (in bytes) of the destination buffer. Must not be 0.

Returns the number of bytes written, excluding the null terminator.

It is safe to call this function from any thread.

This function is available since SDL 3.2.0.

(3), SDL_strlcpy(3)

SDL 3.2.10 Simple Directmedia Layer