Libraries anvil lang string encodeTo

binary encodeTo(string encoding)
Encodes this string to binary using given character encoding, throws IOError if string cannot be mapped
binary encodeTo(string encoding, binary replacement)
Encodes this string to binary using given character encoding, unmappable characters are replaced with given binary
binary encodeTo(string encoding, string replacement)
Encodes this string to binary using given character encoding, unmappable characters are replaced with given string
binary encodeTo(string encoding, null ignore)
Encodes this string to binary using given character encoding, unmappable characters are ignored.
Throws BadParameter -  if given character encoding is unsupported, or replacement is invalid
IOError -  if some characters are unmappable and no replacement given