Declare the type of callback function that converts a local code string to a UTF-8 string.

Syntax

typedef char *(*XML_LOCAL_TO_UTF8_STRING)(
  char *src,
  int length,
  int *error_code,
  size_t *output_length
);

Parameters

src
[in] A pointer to a string of local code.
length
[in] Specifies the number of bytes to convert. Negative values convert the range until the string pointed to by src ends with a NUL.
error_code
[out] A pointer to a variable that returns an error code. Specify NULL when no error code is required.
output_length
[out] A pointer to a variable that returns the number of output bytes excluding the NUL at the end of the conversion result. Specify NULL when the number of output bytes is not required.

Return value

Returns a pointer to the buffer that stores the conversion result if the conversion is successful, NULL otherwise.

Remarks

This type declares the type of the callback function specified in the LocalToUtf8Func parameter of the XML_CreateXmlObject function.

The following functions are compatible with this type and can be specified directly on the LocalToUtf8Func parameter.

You can also use the CONV_LocalToUtf8String function to create a function that does your own code conversion.

Requirements

Header file:
XML.h
CodeConversion.h : ver. 1.1.1 or later.

Last updated: 2021/09/24