Function Entry: CHR

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

Function Entry: CHR

Name

chr

Class

Function

Syntax

(chr integer)

Arguments and Values

  • integer: character code

Autodesk documents the accepted range as 1 to 65536 in Unicode-capable behavior.

Description

Returns a one-character string corresponding to the given character code.

Return Values

String of length one under ordinary observable semantics.

Side Effects

None.

Compatibility

Like ascii, chr is affected by the pre-Unicode / post-Unicode split.

Measured: character codes at LISPSYS 0

probe-triage2, 2026-10-04 (strings built with chr, never source literals):

  • AutoCAD 2022, Windows, LISPSYS 0 (job 16923993438): (chr 8364) is the character of code 172 – 8364 reduced to a byte, the windows-1252 ¬ – so (ascii (chr 8364)) is 172 and (vl-string->list (chr 8364)) is (172); (ascii (chr 128)) is 128.
  • BricsCAD V25, Windows, LISPSYS 0 (job 16923993442): (chr 8364) is the euro, code 128 – its windows-1252 byte: (ascii (chr 8364)) 128, (vl-string->list (chr 8364)) (128).
  • BricsCAD V26, macOS, LISPSYS 0 (job 16923993439): Unicode code points, 8364 throughout.
  • (strlen (chr 8364)) is 1 on all three. Under LISPSYS 1 / 2 (AutoCAD 2021+, documented) codes are Unicode code points.

clautolisp

Characters are Unicode inside clautolisp; the dialect decides the CODE a character has and the character a code names – for chr, ascii, vl-string->list, vl-list->string, vl-string-elt, vl-string-position, read-char and write-char alike. Under an AutoCAD Windows dialect before 2021, or at LISPSYS 0, a code is reduced to a byte read as windows-1252; under a BricsCAD Windows dialect at LISPSYS 0, windows-1252 for the characters it has and Unicode beyond; otherwise Unicode code points.

Availability

  • AutoCAD 2026: documented (per Autodesk reference page).
  • BricsCAD V26: presumed compatible (no contradicting page found).
  • Status: AutoCAD documented; BricsCAD presumed-both pending Phase 4 verification.

Notes

  • Autodesk documents that AutoCAD 2021 changed chr from legacy ASCII-oriented behavior to Unicode-code-point-oriented behavior when LISPSYS is 1 or 2.