FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version

string-to-octets

Arguments: string &key (null-terminate t) (start 0) (end (length string)) mb-vector make-mb-vector? (external-format :default)

In releases prior to 6.0, this function was named string-to-mb. The old name is preserved for backward compatibility, but users should use the new name.

This function returns a Lisp (simple-array (unsigned-byte 8) (*)) vector and the number of bytes copied.

This function converts (according to the external-format argument) and copies the string data from indices specified by start to end out of the lisp string into a lisp array of type (simple-array (unsigned-byte 8) (*)). This array is returned.

If the mb-vector argument is specified, then its value will be used (and returned) as the destination lisp array. If a vector is specified with the mb-vector argument and it is not long enough, an error is signaled unless make-mb-vector? is specified as non-nil, in which case a new vector is created and returned (and mb-vector is ignored).

When the null-terminate argument is true, the copied string data (in the resulting vector) is null-terminated, that is the byte following the last data element is 0. The number of 8-bit bytes copied including the null-terminator is returned as the second value of this function.

Conversion is done using the specified external-format. If external-format is not specified (or, equivalently, if the value of external-format is :default), then the external format returned by the following form is used:

(locale-external-format *locale*)

See locale-external-format and *locale*.

See also octets-to-string and string-to-native.

See also iacl.htm for general information on international character set support in Allegro CL.


Copyright (c) 1998-2022, Franz Inc. Lafayette, CA., USA. All rights reserved.
This page was not revised from the 10.0 page.
Created 2019.8.20.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 10.1
Unrevised from 10.0 to 10.1.
10.0 version