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

Syntax

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

Parameters

src
[in] A pointer to a string of UTF-8.
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 Utf8ToLocalFunc parameter of the XML_CreateXmlObject function.

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

You can also use the CONV_Utf8ToLocalString 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