EncodeCharSet (open)

Convert a string to a specific character set

Syntax

LOADLIB "wh::system.whlib";

STRING FUNCTION EncodeCharSet(STRING text, STRING charset)

Parameters

STRING text

Text to convert

STRING charset

Destination character set (US-ASCII, CP1252, ISO-8859-1 or UNICODE(UTF-8))

Return value

STRING

The text as a sequence of bytes in the requested character set. An empty string if the character set is unknown

Description

Converts a string to a character set. Characters that do not exist in the new character set are omitted.

Examples

//Returns "mlauts and uro's don't mix"
EncodeCharSet("Ümlauts and €uro's don't mix", "US-ASCII")