logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SDL_utf8strlcpy - Copy an UTF-8 string.

Availability

       This function is available since SDL 3.2.0.

Description

       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.

Function Parameters

dst    The destination buffer. Must not be NULL, and must not overlap with src.

       src    The null-terminated UTF-8 string to copy. Must not be NULL, and must not overlap with dst.

       dst_bytes
              The length (in bytes) of the destination buffer. Must not be 0.

Name

       SDL_utf8strlcpy - Copy an UTF-8 string.

Return Value

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

See Also

SDL_strlcpy(3)

Simple Directmedia Layer                           SDL 3.2.20                                 SDL_utf8strlcpy(3)

Synopsis

#include<SDL3/SDL_stdinc.h>size_tSDL_utf8strlcpy(char*dst,constchar*src,size_tdst_bytes);

Thread Safety

       It is safe to call this function from any thread.

See Also