The initial value of
*default-character-element-type* is
base-char,
to avoid programs that only require 8-bit strings needlessly creating larger string objects. If your application uses Unicode characters beyond the Latin-1 range (characters of type
extended-char
) then you should consider which of the following two approaches to use:
extended-char
s are constructed explicitly with the appropriate type. This is the conservative approach, allowing you to avoid allocation of 16-bit strings where these are not required. Note that you can use the specialized accessors such as
stchar
for strings of type simple-text-string.
(
set-default-character-element-type 'simple-char)
Bear in mind that this is a global setting which affects default string construction for the entire system. It could be called from a user interface, depending on whether the user needs to handle
extended-char
s.Note: Do not attempt to bind or set directly the variable *default-character-element-type*. Instead, call set-default-character-element-type.
LispWorks User Guide and Reference Manual - 21 Dec 2011