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_iconv - This function converts text between encodings, reading from and writing to a buffer.

Availability

       This function is available since SDL 3.2.0.

Description

       It returns the number of succesful conversions on success. On error, SDL_ICONV_E2BIG is returned when the
       output  buffer  is  too  small,  or  SDL_ICONV_EILSEQ  is  returned  when  an  invalid  input sequence is
       encountered, or SDL_ICONV_EINVAL is returned when an incomplete input sequence is encountered.

       On exit:

       • inbuf will point to the beginning of the next multibyte sequence. On error, this is the location of the
       problematic input sequence. On success, this is the end of the input sequence.

       • inbytesleft will be set to the number of bytes left to convert, which will be 0 on success.

       • outbuf will point to the location where to store the next output byte.

       • outbytesleft will be set to the number of bytes left in the output buffer.

Function Parameters

cd     The character set conversion context, created in SDL_iconv_open().

       inbuf  Address of variable that points to the first character of the input sequence.

       inbytesleft
              The number of bytes in the input buffer.

       outbuf Address of variable that points to the output buffer.

       outbytesleft
              The number of bytes in the output buffer.

Name

       SDL_iconv - This function converts text between encodings, reading from and writing to a buffer.

Return Value

       Returns the number of conversions on success, or a negative error code.

See Also

SDL_iconv_open(3), SDL_iconv_close(3), SDL_iconv_string(3)

Simple Directmedia Layer                           SDL 3.2.20                                       SDL_iconv(3)

Synopsis

#include<SDL3/SDL_stdinc.h>size_tSDL_iconv(SDL_iconv_tcd,constchar**inbuf,size_t*inbytesleft,char**outbuf,size_t*outbytesleft);#defineSDL_ICONV_ERROR(size_t)-1/**<Genericerror.CheckSDL_GetError()?*/#defineSDL_ICONV_E2BIG(size_t)-2/**<Outputbufferwastoosmall.*/#defineSDL_ICONV_EILSEQ(size_t)-3/**<Invalidinputsequencewasencountered.*/#defineSDL_ICONV_EINVAL(size_t)-4/**<Incompleteinputsequencewasencountered.*/

See Also