Repository navigation
Open
Labels
area:string-streamR2007+ split string and handle streamspriority:P2Quality and completenessrelease:R13Affects R13 filesrelease:R14Affects R14 filesrelease:R2000Affects R2000 filesrelease:R2004Affects R2004 filestype:bugSomething reads, writes or reports wrongly
Description
#374 decodes pre-R2007 text in the code page named by the file header. Its table holds only the two pages that an AutoCAD export in the pinned corpus names:
| Header short | Page | Drawings |
|---|---|---|
| 29 | ANSI_1251 | 14 |
| 30 | ANSI_1252 | 2 |
Every other short reads as CodePage::Unknown and decodes as before. The spec (§3.2.5) says only "a raw short" and prints no table. No value was taken from another implementation (see CLEANROOM.md).
What is not proven
- No real drawing tests the decoder. None of the 24 pre-R2007 drawings in the pinned corpus holds a string with a byte above 0x7F (0 of 9,076 strings). The 612/612 result in fix(entities): read pre-R2007 text in the code page the header names (§3.2.5, #370) #374 comes from
examples/probe_code_page.rsrewriting strings in memory, so it proves the plumbing and the charts, not AutoCAD's bytes. - No pages beyond 1251 and 1252. Not covered: 1250 (Central European), 1253 (Greek), 1254 (Turkish), 1255 (Hebrew), 1256 (Arabic), 1257 (Baltic), 1258 (Vietnamese), 874 (Thai), 932 (Japanese), 936 (Simplified Chinese), 949 (Korean), 950 (Traditional Chinese), and the DOS and ISO pages. The double-byte pages (932, 936, 949, 950) also need checking for how MTEXT and other strings hold characters the page lacks.
- R14 is assumed. Shorts 29 and 30 are applied to R14 from the later releases; no R14 export names them.
- Writers still emit UTF-8. The page-aware inverse is owed (ARCHITECTURE.md §7ao).
- XRECORD and XDATA strings are not decoded by page.
Done when
For each page added to the table, one public or AutoCAD-made pre-R2007 drawing whose header names that page, and whose AutoCAD DXF export agrees with our decode, is pinned or recorded as local evidence. For 1252, that means a real drawing with accented text in TEXT, MTEXT, layer, block and attribute strings, decoded equal to its export.
Sources to try
- The AutoCAD trial (
.git/train/AUTOCAD-TODO.md§4). On an English install it can make real 1252 drawings, and it can show how characters outside the page are stored. Other pages may need a different system locale. - Public archives of pre-2007 drawings from Japanese, Chinese, Korean, Greek and Central European sources, each with an AutoCAD DXF export.
Metadata
Metadata
Assignees
Labels
area:string-streamR2007+ split string and handle streamspriority:P2Quality and completenessrelease:R13Affects R13 filesrelease:R14Affects R14 filesrelease:R2000Affects R2000 filesrelease:R2004Affects R2004 filestype:bugSomething reads, writes or reports wrongly
Activity
docs: the README names #374 as landed and #375 as what remains of cod…
DrunkOnJava commentedon Oct 27, 2026
Research update (2026-10-27): about 1,350 GitHub repositories and about 100 open-data datasets were checked. Nothing is committed yet. The full tables are local to the maintainer's machine, outside the repository.
The header short is an enum, not a Windows page number. Pre-R2007 drawings with a DXF export of the same drawing (matched by
$FINGERPRINTGUID) map these shorts:Caveats:
Pin-able (permissive licence, fetched at run time, never committed):
kurema/BookViewerApp3: MIT, AC1014, short 38,レイアウト1.Seeed-Studio/OSHW-Jetson-Series: Apache-2.0, AC1018, short 39,布局1.None of the pin-able files has both a DXF twin and non-ASCII text. Their proof is the localized layout-name constants, which a decode either reproduces or does not.
Local evidence only (no or incompatible licence):
tbs-trappy/source_one: AC1018, short 41, with a Big5 twin.Makeroni/Eye-of-Horus: AC1018, 1252 withPresentación1and a twin.Not found: any pre-R2007 file for 1258, the DOS or ISO pages, or short 31. Shorts 35 (Arabic) and 37 (Thai) appear only on AC1032 files.
The code-page lane picks this up next: table rows backed by these drawings, the pins, and real-file decodes of the layout-name constants.
fix(probe): keep comparing an XRECORD after a save-time value and che…
fix(code_page): encode a character only when its bytes decode back to…
test(corpus): ratchet the nine new pinned drawings, nine BLOCK_HEADER…
fix(probe): pair extended data by application and allow only the RTTc…
fix(probe): let only an ACAD application of an MTEXT record lack the …
docs(code_page): point the module docs at this change's ARCHITECTURE …
docs: bring README.md and RELEASE.md up to main, and render the measu…
feat(objects): read XRECORD values and extended entity data in the co…
docs(architecture): the merged probe's patched-copy numbers, XRECORD …
feat(writer): write the drawing's code page, not UTF-8 or bare escape…
feat(code_page): name the header shorts 28 to 41 that real drawings p…
fix(tables): read the whole insert-count run of a BLOCK_HEADER (§20.4…
fix(code_page): read the page writer's bytes back under the page, now…
test(code_page): prove decode then encode returns the bytes read on t…
DrunkOnJava commentedon Oct 27, 2026
Status on main after 7f4d63c (2026-10-27):
Done
$DWGCODEPAGEof AutoCAD's export of the same drawing, or by a known text found in the drawing's bytes (ARCHITECTURE.md §7au).dwg-to-dxfand the DWG writer write the drawing's page, not UTF-8 (feat(writer): write the drawing's code page, not UTF-8 or bare escapes (§3.2.5, #375) #382, §7at). A character the page lacks is written as\U+XXXX.Still open here
tools/autocad/, feat(tools): scripts and runbook for the AutoCAD trial (#119, #348, #375) #383) is the planned source.feat(dxf): write the LAYOUT, GROUP and MLINESTYLE objects, paired wit…
feat(tools): scripts and runbook for the AutoCAD trial (#119, #348, #375