hw_GetEncoding -- get current script's encoding (V7.0)
int hw_GetEncoding(struct hwTagList *tags);
This function returns the encoding used by the script. By default, all scripts will use HWOS_ENCODING_UTF8 unless they explicitly request to run in ISO 8859-1 mode. Note that even if a script requests ISO 8859-1 encoding, hw_GetEncoding() will still return HWOS_ENCODING_UTF8 if you call it while being in either the InitPlugin() or InitLibrary() function because the encoding requested by the script will be set while parsing it and both InitPlugin() and InitLibrary() are called before that.

Thus, it is probably a better idea to install a callback of type HWCB_ENCODINGCHANGE. Such a callback will be run immediately whenever the encoding changes. See hw_RegisterCallback for details.

This function can return the following values:

UTF-8. This is Hollywood's default encoding since version 7.0.

ISO 8859-1. This was Hollywood's default encoding before version 7.0. It is still supported for compatibility reasons but it should not be used by new scripts.

You may also pass a tag list to hw_GetEncoding() that can contain the following tags:

This tag allows you to get the current string encoding. For compatibility reasons, Hollywood uses two different encodings: a script encoding and a string encoding. Normally, those two are the same, though. To use this tag, pass a pointer to an int in the pData member of the tag. Hollywood will then return the current string encoding in that int. (V9.0)

Designer compatibility

reserved for future use; pass NULL for the time being

Show TOC