intlConvertString

Changes certain attributes of a string.

Synopsis

int32 intlConvertString(Item locItem,const unichar *string,unichar *result, uint32 resultSize,uint32 flags);

Description

Converts character attributes within a string. The flags argument specifies the type of conversion to perform.

Arguments

locItem
A locale item, as obtained from intlOpenLocale().
string
The string to convert.
result
Where the result of the conversion is put. This area must be at least as large as the number of bytes in the string.
resultSize
The number of bytes available in the result buffer. This limits the number of bytes that are put into the buffer.
flags
Description of the conversion process to apply:

INTL_CONVF_UPPERCASE will convert all characters to uppercase if possible.
INTL_CONVF_LOWERCASE will convert all characters to lowercase if possible.
INTL_CONVF_HALFWIDTH will convert all FullKana characters to HalfKana.
INTL_CONVF_FULLWIDTH will convert all HalfKana characters to FullKana.
INTL_CONVF_STRIPDIACRITICALS will remove diacritical marks from all characters.
You can also specify:

(INTL_CONVF_UPPERCASE|INTL_CONVF_STRIPDIACRITICALS) or (INTL_CONVF_LOWERCASE|INTL_CONVF_STRIPDIACRITICALS) in order to perform two conversions in one call. If flags is 0, then a straight copy occurs.

Return Value

If positive, returns the number of characters in the result buffer. If negative, returns an error code. The string copied into the result buffer is guaranteed to be NULL-terminated.

> = 0
Number of characters copied.
INTL_ERR_BADSOURCEBUFFER
The string pointer supplied was bad.
INTL_ERR_BADRESULTBUFFER
The result buffer pointer was NULL or wasn't invalid writable memory.
INTL_ERR_BUFFERTOOSMALL
There was not enough room in the result buffer.
INTL_ERR_BADITEM
locItem was not an existing locale item.

Implementation

Folio call implemented in international folio V24.

Associated Files

intl.h

Caveats

This function varies in intelligence depending on the language bound to the Locale argument. Specifically, most of the time, all characters above 0x0ff are not affected by the routine. The exception is with the Japanese language, where the Japanese characters are also affected by this routine.

See Also

intlOpenLocale(), intlCompareStrings()