STDConvertUnicodeCallback

Definition

#include <nitro/std.h>
typedef STDResult (*STDConvertUnicodeCallback) (u16 *dst, int *dst_len, const char *src, int *src_len);

Arguments

dst Pointer to the location of the converted Unicode character.
dst_len Passing the maximum number of characters that can be stored in the conversion destination buffer, this pointer returns the number of characters actually stored.
Note that this is not equal to the byte size.
src Pointer to the location where conversion of the Shift-JIS string failed.
src_len This pointer takes the byte size of the remaining unconverted string indicated by src, and returns the byte size that was actually required for conversion.

Return Values

Returns STD_RESULT_SUCCESS if conversion succeeds. Otherwise, returns STD_RESULT_CONVERSION_FAILED.
Store and return the number of characters that were actually used in conversion in the arguments dst_len and src_len.

Description

The type of the callback function configured with the STD_ConvertStringSjisToUnicode function. This function is called every time the STD_ConvertStringSjisToUnicode function detects a character that cannot be converted. You are free to define conversion processing here.

A four-character array is always guaranteed for dst. Use it to store characters that result from conversion. You do not need to append a NULL terminator.
In src_len, store the byte size of one character's worth of the src being read for this conversion cycle.

If the result of conversion is continually two or more characters and either src or dst exceed the end of buffer, the conversion results are ignored and this function assumes the end was reached.

See Also

STDResult
STD_ConvertStringSjisToUnicode

Revision History

2006/08/10 Changed the interface.
2006/07/24 Changed the interface. Added a description of restrictions on return values.
2006/07/05 Initial version.


CONFIDENTIAL