ConvertASCII2ShiftJIS

Converts an ASCII string to Shift-JIS.

Synopsis

int32 ConvertASCII2ShiftJIS(const char *string,char *result, uint32 resultSize,uint8 unknownFiller);

Description

Converts a string from ASCII to Shift-JIS. The conversion is done as well as possible. If certain characters from the source string cannot be represented in ASCII, the unknownFiller byte will be inserted in the result buffer in their place.

Arguments

string
The string to convert.
result
A memory buffer where the result of the conversion can be put.
resultSize
The number of bytes available in the result buffer. This limits the number of bytes that are put into the buffer.
unknownFiller
If a character sequence cannot be adequately converted, then this byte will be put into the result buffer in place of the character sequence.

Return Value

If positive, returns the number of characters in the result buffer. If negative, returns an error code.

> = 0
Number of characters in the result buffer.
JSTR_ERR_BUFFERTOO
SMALL
There was not enough room in the result buffer.

Implementation

Folio call implemented in jstring folio V24.

Associated Files

jstring.h