Sets the current string encoder to the one specified.
Syntax
.stringencoder encoder
Remarks
If a particular encoding cannot represent a character properly, it is recommended that the encoder returns a question-mark (or similar suitable character) in its place.
The parameter encoder can also be a code page number or an internal encoding name.
WarningIf you specify the name or code page of a multibyte encoding not implemented by a Brass plugin be warned that these are not as reliable and rely on some guesswork (especially as far as endianness issues are concerned) so if you need a particular encoding consider writing a proper Brass plugin to handle it.
Examples
.stringencoder ascii
.echoln "é" == "?"
.stringencoder utf8
.echoln "é" == "?"
.stringencoder "windows-1252"
.echoln char($80) ; Displays a € sign.
.stringencoder utf8
.db "This will be encoded as UTF-8."
If you specify the name or code page of a multibyte encoding not implemented by a Brass plugin be warned that these are not as reliable and rely on some guesswork (especially as far as endianness issues are concerned) so if you need a particular encoding consider writing a proper Brass plugin to handle it.