Name
hw_ConvertString -- convert string between character encodings (V6.0)
Synopsis
STRPTR s = hw_ConvertString(STRPTR in, int infmt, int outfmt,
                                struct hwTagList *tags);
Function
This function converts the string specified from infmt to outfmt and returns it. hw_ConvertString() allocates the resulting string for you. You have to free this string using hw_FreeString() then.

The following formats are currently available:

HWOS_ENCODING_ISO8859_1:
ISO 8859-1. This is the default encoding in Hollywood version older than 7.0.

HWOS_ENCODING_UTF8:
UTF-8. This is the default encoding since Hollywood 7.0.

HWOS_ENCODING_AMIGA:
The system charset on AmigaOS and compatibles. This is obviously only supported on AmigaOS and compatibles. Note that HWOS_ENCODING_AMIGA can only be converted to and from HWOS_ENCODING_UTF8. It must not be used together with HWOS_ENCODING_ISO8859_1. (V7.0)

The tag list passed in tags may contain the following tags:

HWCSTAG_LENGTH:
This tag can be used to specify the length of the input string in bytes. If this tag is not set, the input string needs to be NULL-terminated. (V9.0)

Designer compatibility
Supported since Designer 5.0 but without the HWCSTAG_LENGTH tag

Inputs
in
string to convert
infmt
format of the source string (see above)
outfmt
desired destination format (see above)
tags
currently unused; pass NULL
Results
s
converted string (NULL-terminated) or NULL on error

Show TOC