Converts a CP437_ose string to a UTF-8 string.

Syntax

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

Parameters

src
[in] A pointer to a CP437_ose string.
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

Converts a string of the length specified by length from the beginning of the CP437_ose string pointed to by src to a UTF-8 string, and returns a pointer to the buffer that stores the conversion result.

If you specify a negative value for length, the range until the string pointed to by src ends with NUL is converted.

If a NUL is detected before the string pointed to by src reaches the length specified by length, the string up to the NUL is converted.

If the conversion is successful, end the conversion result string with a NUL and return the number of bytes of the conversion result excluding the NUL to the variable pointed to by output_length.

If the conversion fails, it returns NULL and returns the following error code in the variable pointed to by error_code.
Error codeDesription
CONV_INVALID_PARAMETER_ERRORParameter error.
CONV_MEMORY_ALLOCATION_ERRORMemory allocation error.

If this function returns a value other than NULL, you need to free the buffer with the free function.

Requirements

Header file:
CodeConversion.h
Library file:
libCodeConversion.a
libSTARTUPOPH5000.a


Last updated: 2021/08/02