Charset.canEncode

Check to see if the UTF-8 text will fit safely within charset.

struct Charset
bool
canEncode
(
string charset
,
string text
)

Parameters

charset string

a charset

text string

utf-8 text to check

Return Value

Type: bool

true if it is safe to encode text into charset or false otherwise.