string>alien ( string encoding -- byte-array )
Factor handbook » C library interface » Passing data between Factor and C » C strings

Next:malloc-string ( string encoding -- alien )


Vocabulary
alien.strings

Inputs
stringa string
encodingan encoding descriptor


Outputs
byte-arraya byte-array


Word description
Encodes a string together with a trailing null code point using the given encoding, and stores the resulting bytes in a freshly-allocated byte array.

Errors
Throws an error if the string contains null characters, or characters not representable in the given encoding.

See also
alien>string, malloc-string

Definition

GENERIC#: string>alien 1 ( string encoding -- byte-array )


Methods