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-charis 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), not233.- This makes
read-charandwrite-charasymmetric:write-charemits a character in the platform encoding, whileread-charreads bytes. The pair round-trips only on single-byte platforms — seewrite-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
- [read-char (AutoLISP)](https://help.autodesk.com/cloudhelp/2024/KOR/AutoCAD-AutoLISP-Reference/files/GUID-7E94BD14-F018-47D0-88DA-2B08DE32DB2C.htm)
- Runtime probe: alpm
tests/verification/verification.lsp(V-10), 2026-08-09. - Status: documented.