Function Entry: READ-CHAR

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

Function Entry: READ-CHAR

Name

read-char

Class

Function

Syntax

(read-char [file-desc])

Description

Reads a character from a file descriptor or the keyboard buffer.

Return Values

Returns a character code according to the host's character model.

Compatibility

  • Autodesk documents Unicode-related return behavior changes in 2021+
  • newline normalization is documented

Notes

  • read-char is byte-level — verified 2026-08-09 on all four engine combinations. It returns raw bytes one at a time, never decoded characters. Reading back a character stored as UTF-8 yields the individual bytes: on BricsCAD V26 macOS, a file holding é reads as (195 169), not 233.
  • This makes read-char and write-char asymmetric: write-char emits a character in the platform encoding, while read-char reads bytes. The pair round-trips only on single-byte platforms — see write-char § Notes for the full picture and the portability consequence.

Availability

  • AutoCAD 2026: documented (per Autodesk reference page).
  • AutoCAD 2022, BricsCAD V25 and V26: byte-level behaviour verified by runtime probe 2026-08-09.
  • Status: verified on both vendors (no longer "presumed compatible").

Source Notes