sdlIconv function
This function converts text between encodings, reading from and writing to a buffer.
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.
\param cd The character set conversion context, created in SDL_iconv_open(). \param inbuf Address of variable that points to the first character of the input sequence. \param inbytesleft The number of bytes in the input buffer. \param outbuf Address of variable that points to the output buffer. \param outbytesleft The number of bytes in the output buffer. \returns the number of conversions on success, or a negative error code.
\since This function is available since SDL 3.1.3.
\sa SDL_iconv_open \sa SDL_iconv_close \sa SDL_iconv_string
extern SDL_DECLSPEC size_t SDLCALL SDL_iconv(SDL_iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
Implementation
int sdlIconv(
Pointer<SdlIconvT> cd,
Pointer<Pointer<Int8>> inbuf,
Pointer<Uint32> inbytesleft,
Pointer<Pointer<Int8>> outbuf,
Pointer<Uint32> outbytesleft) {
final sdlIconvLookupFunction = libSdl3.lookupFunction<
Uint32 Function(
Pointer<SdlIconvT> cd,
Pointer<Pointer<Int8>> inbuf,
Pointer<Uint32> inbytesleft,
Pointer<Pointer<Int8>> outbuf,
Pointer<Uint32> outbytesleft),
int Function(
Pointer<SdlIconvT> cd,
Pointer<Pointer<Int8>> inbuf,
Pointer<Uint32> inbytesleft,
Pointer<Pointer<Int8>> outbuf,
Pointer<Uint32> outbytesleft)>('SDL_iconv');
return sdlIconvLookupFunction(cd, inbuf, inbytesleft, outbuf, outbytesleft);
}