encode ( string encoding -- byte-array )
Factor handbook » Input and output » I/O encodings » Encoding and decoding strings

Next:decode ( byte-array encoding -- string )


Vocabulary
io.encodings.string

Inputs
stringa string
encodingan encoding descriptor


Outputs
byte-arraya byte-array


Word description
Converts a string into a byte array, interpreting that string with the given encoding.

Examples
USING: io.encodings.string io.encodings.utf8 prettyprint ; "我爱你" utf8 encode .
B{ 230 136 145 231 136 177 228 189 160 }


Definition