Minimal DXF file for texts in Cyrillic

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello!
I'm writing a custom program which writes data in DXF format. I'm saving only entities like points and texts. Till now it works as expected, but I have problems when the texts are in Cyrillic. When loaded in AutoCAD, the texts are not properly displayed - texts in Latin are readable, but those in Cyrillic aren't:
Attached you can find:
- DXF file with Cyrillic characters: withoutHeader- can be loaded in AutoCAD.
- The same DXF file with HEADER section added: withHeader - gives an error when loaded in AutoCAD.
I've found a similar thread here: bad-decoding-of-dxf-file-with-properly-encoded-strings. According to it, DXF files after AutoCAD 2007 can be encoded in UTF-8 (mine files are). So I've tried to set $ACADVER to be AC1024 (for AutoCAD 2010) and I was expecting the texts will be displayed correctly as the encoding of the file is UTF-8:
0 SECTION 2 HEADER 9 $ACADVER 1 AC1024 9 $DWGCODEPAGE 3 ANSI_1251 0 ENDSEC ... rest of the DXF string
But when loaded in AutoCAD it gives an error:
Error in APPID Table DXF read error on line 102. Invalid or incomplete DXF input -- drawing discarded.
I assume that the HEADER section is not complete and missing some required parameters but don't know which are they.
Can someone points me out how to properly set $ACADVER variable, or what are the minimal variables to be set in the HEADER section?