STDConvertSjisCallback

Definition

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

Arguments

dst Pointer to the location storing the converted Shift-JIS character.
dst_len Accepting the maximum byte size that can be stored in the destination buffer, this pointer returns the byte size actually stored.
src Pointer to the location where conversion of the Unicode string failed.
srclen Accepting the remaining number of unconverted characters that src points to, this pointer returns the number of characters actually required for conversion.

Return Values

Returns STD_RESULT_SUCCESS if conversion succeeds. Otherwise, returns STD_RESULT_CONVERSION_FAILED.
Be sure to store the number of characters actually used in conversion in the arguments dst_len and src_len.

Description

The type of the callback function configured with the STD_ConvertStringUnicodeToSjis function. This callback is called every time a character that cannot be converted by the STD_ConvertStringUnicodeToSjis function is detected. Conversion processing can be freely defined here.

A four-character array is always guaranteed for dst. Store characters that result from conversion here. A null terminator does not need to be added.
Be sure to store the number of characters in one character's worth of src to be read for conversion in srclen. (Note that the number of characters does not give the byte size.)

If the result of conversion is two or more characters and either src or dst exceed the end of the buffer, the result will be ignored and will be treated as if the end of buffer has been reached.

See Also

STDResult
STD_ConvertStringUnicodeToSjis

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