ENCCheckEncoding

Syntax

#include <revolution/enc.h>

ENCResult ENCCheckEncoding(s32* index, const u8** encodings, s32 encsize, const u16* src, s32 srclen);

Arguments

index Stores the array index of the convertible character encoding. If a convertible character encoding is not found, ENC_CHECK_NOT_FOUND will be stored.
encodings Array of conversion candidate character encoding.
Specifies the array of character encoding name string expression.
encsize Array size of conversion candidate character encoding.
Maximum specifiable count is defined as ENC_ENCODING_COUNT.
src Buffer of checked internal encoding string.
srclen Buffer size of checked internal encoding string. A string larger than specified by srclen will not be read.
If srclen is NULL or a negative value, src will be loaded until the termination character is found.
If srclen is not NULL, it will store the size of the loaded string buffer.

Return Values

ENC_OK: Normal exit.
ENC_ERR_INVALID_PARAM: Invalid argument.
ENC_ERR_UNKNOWN_ENCODING: Unknown character encoding.
ENC_ERR_UNSUPPORTED: Unsupported character code conversion.

Description

Determines the convertible character encoding from the internal encoding.

In encodings, specify the array of strings that represents character encoding of conversion candidates; in encsize, specify the array's size. If a non-recognizable character encoding is specified, the corresponding encoding name index is stored in index and ENC_ERR_UNKNOWN_ENCODING is returned. If an unsupported conversion of character code is specified, the corresponding encoding name index is stored in index and ENC_ERR_UNSUPPORTED is returned.

Convertibility is determined in the character encoding order specified in encodings; the array index of the first found character encoding is stored in index. If a convertible character encoding is not found, ENC_CHECK_NOT_FOUND will be stored in index.

srclen is the byte conversion buffer size.

ENC_ERR_NOT_LOADED was eliminated in RevolutionSDK 3.2.
If you specify a character encoding whose conversion table has been stripped, this function will return ENC_ERR_UNSUPPORTED.

See Also

None.

Revision History

2008/03/31 Eliminated ENC_ERR_NOT_LOADED.
2007/02/05 Added ENC_ERR_NOT_LOADED.
2006/10/19 Initial version.


CONFIDENTIAL