string-to-mb

$Revision: 1.1.2.3 $

Function

Package: EXCL

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

This function returns a lisp-usb8-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 cretaed and returned (and mb-vector is ignored).

The copied string data (in the resulting vector) is null-terminated, ie, 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.

By default, this function will convert to the native representation assumed for foreign function strings. Under International Allegro CL, this conversion is to EUC (ie, external-format :euc) under Unix, and to Windows MultiByte (ie, external-format :mb) under Windows. Overriding the default external-format is not supported in  this Allegro CL release. When :default is specified, the value of excl:*default-external-format* is used.

See also mb-to-string.

International Allegro CL is described in iacl.htm. The general documentation description is in introduction.htm. The index in index.htm.

Copyright (C) 1998-1999, Franz Inc., Berkeley, CA. All Rights Reserved.