Converts Unicode to SJIS character code.

Syntax

char *CONV_UnicodeToSjis(
  unsigned short unicode
);

Parameters

unicode
[in] Unicode

Return value

If the conversion is successful, it returns a pointer to the buffer containing the character code of SJIS, otherwise NULL.

Remarks

Converts the Unicode specified in unicode to the character code of SJIS.

If the converted SJIS code is 1-byte code, store it in the 1st byte of a 2-byte buffer, set NUL in the 2nd byte, and return a pointer to this buffer.
2-byte buffer:
+0 1-byte code
+1 NUL

If the converted SJIS code is a 2-byte Shift JIS code, store the 1st byte of Shift JIS in the 1st byte of a 2-byte buffer, store the 2nd byte of Shift JIS in the 2nd byte of the buffer and returns a pointer to this buffer.
2-byte buffer:
+0 1st byte of Shift JIS
+1 2nd byte of Shift JIS

If the character code of SJIS corresponding to the specified Unicode does not exist, NULL is returned.

Requirements

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


Last updated: 2021/07/20