Pre-Unicode and Post-Unicode Semantics

← Prev | ↑ Chapter | Next → | Index | Symbols

Pre-Unicode and Post-Unicode Semantics

Pre-2021 Autodesk Model

Before AutoCAD 2021, Autodesk documents string and character behavior in terms that were effectively tied to legacy text encodings.

In particular, Autodesk's current function notes say that earlier behavior for functions such as ascii, chr, vl-string-*, and read-char reflected ASCII or MBCS-oriented handling rather than full Unicode semantics.

Observable consequences of the pre-2021 model include:

  • character-oriented functions were effectively limited by legacy encoding assumptions,
  • file text handling depended on older platform encoding behavior,
  • string-position and character-code behavior for non-ASCII text was not Unicode-clean in the modern sense.

Post-2021 Autodesk Model

Beginning with AutoCAD 2021, Autodesk explicitly introduced Unicode-related changes controlled by LISPSYS.

From the documentation sampled here, the post-2021 model includes at least:

  • Unicode-aware string handling,
  • revised behavior for string-search and character-code functions,
  • revised read-char behavior,
  • explicit file-opening encoding support,
  • an implementation switch through LISPSYS.

LISPSYS values are documented as selecting different engine behavior:

  • legacy ASCII engine behavior,
  • Unicode engine behavior,
  • Unicode engine behavior with compatibility adjustments, depending on Autodesk release details.

For the purposes of this specification, the important normative point is:

  • string semantics after AutoCAD 2021 are versioned and mode-dependent,
  • the language cannot be specified correctly without recording the active Unicode mode.

BricsCAD

BricsCAD documentation sampled here also indicates explicit Unicode-aware text-file handling through extended open modes.

This suggests that:

  • BricsCAD should not be modeled purely as a pre-Unicode AutoLISP environment,
  • text and encoding behavior must remain part of the dialect/environment profile.

clautolisp dispatch for LISPSYS

clautolisp accepts (getvar "LISPSYS") and (setvar "LISPSYS" n) under every dialect — extensions are always available, the dialect controls diagnostic emission. Per encoding-dispatch.issue:

Dialect GETVAR / SETVAR on LISPSYS
--autocad-2026 silent (native dialect)
--strict enc-extension-used
--bricscad-v26 enc-foreign-dialect / bricscad
--clautolisp enc-foreign-dialect / clautolisp

Additionally, (setvar "LISPSYS" n) with n \notin {0,1,2} emits enc-lispsys-out-of-range under all dialects; the write itself still proceeds (matching the vendor 'permissive but warn' behaviour). The diagnostics are advisory — user code that calls LISPSYS keeps running under every dialect; only the diagnosis varies. See the encoding-dispatch.issue 'Diagnostics' section for the full enc-* code table.