GetBestCharacterSet (open)

Get the smallest character set in which a string would fit

Syntax

// Core function, no LOADLIB necessary

STRING FUNCTION GetBestCharacterSet(STRING text)

Parameters

STRING text

Text for which a small character set is requested

Return value

STRING

A character set, eg US-ASCII if the whole text is 7bit, ISO-8859-1 for european texts and UNICODE for mixed text and extended characters

Description

This function determines the smallest character set in which the string fits. This is usefull if you want to communicate with other programs that do not support UNICODE.

Examples

//Returns "Unicode"
GetBestCharacterset("€uro");

// Returns "ISO-8859-1"
GetBestCharacterset("Ümlauts");

//Returns "US-ASCII"
GetBestCharacterSet("hello");