Text export

Text export

vladop
Advisor Advisor
1,174 Views
18 Replies
Message 1 of 19

Text export

vladop
Advisor
Advisor

For some time now I have had two problems with exporting text from AutoCAD that I can't solve:

1. When I copy from Attribute Editor

vladop_0-1757460171440.png

in Notepad I get text with formatting code 

 

vladop_1-1757460189620.png

 

2. When I export text (e.g. with ATTOUT) that is displayed in AUTOCAD correctly, 

vladop_2-1757460266226.png

in NOTEPAD for Cyrillic letters I get � and for non-ascii Latin letters \U+ code.

 

vladop_3-1757460617486.png

 

ATTIN import works without problems with all letters.

"Beta: Use Unicode UTF-8 for worldwide language support" is enabled.

vladop_4-1757460696082.png

Any idea?

0 Likes
1,175 Views
18 Replies
Replies (18)
Message 2 of 19

imadHabash
Mentor
Mentor

Hi,

  1.  Try to Paste into Word or excel first (Use “Paste Special → Unformatted Text”, then copy again to note pad to get rid from those formatting codes.
  2. Open the file in Notepad++ or another editor that supports encoding selection

    • Open the exported .txt file in Notepad++.

    • Go to Encoding → Character sets → Cyrillic → (choose your Windows code page, e.g. Windows-1251).

    • Now all Cyrillic and extended Latin letters will display properly.

Imad Habash

EESignature

0 Likes
Message 3 of 19

vladop
Advisor
Advisor

Hi Imad, thanks for the quick reply.

“Paste Special → Unformatted Text” doesn't help.

Changing to Windows-1251 in Notepad++ only fixed Cyrillic characters.

 

Even the Default encoding for "Save As" in Notepad is UTF-8, not ANSI.

vladop_1-1757482168752.png

 

Copying and pasting in Attribute Editor also adds formatting.

vladop_2-1757482515514.png

 

A month or two ago I experimented with exporting attributes to SQLite using ObjectARX.

I had the same problems with non-ascii characters.

I probably messed something up then.

 

If it was a Windows or AutoCAD update someone else would have had the same problem.

0 Likes
Message 4 of 19

vladop
Advisor
Advisor

In the meantime I have installed a newer version of AutoCAD and it behaves the same.

This suggests that the problem is in Windows.

0 Likes
Message 5 of 19

vladop
Advisor
Advisor

I also had problems in MS Outlook.

I messed up something in Windows.

0 Likes
Message 6 of 19

vladop
Advisor
Advisor

Hello again,
in my lisps I used the "open" function with the encoding option in several places, like
(open fname "w" "utf8")
Everything worked for years until the other day when the error: to many arguments started appearing.
I don't remember changing any settings.
I removed the "utf8" and the error went away, but of course I get files with /U+ codes.
That's it, just to share my bad experience with Unicode in ACAD.

0 Likes
Message 7 of 19

paullimapa
Mentor
Mentor

not sure when this ever changed but the built-in lisp open function only supports two arguments but not three:

(open filename mode) 

https://documentation.help/AutoLISP-Functions/WS1a9193826455f5ff1a32d8d10ebc6b7ccc-698d.htm


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 8 of 19

vladop
Advisor
Advisor

It says here that it has an optional encoding argument:

AutoCAD 2025 Developer and ObjectARX Help | open (AutoLISP) | Autodesk

 

It worked for years.

0 Likes
Message 9 of 19

vladop
Advisor
Advisor

It also says when it was added:

 

History

AutoCAD 2021

  • filename argument previously accepted an ASCII text string, but now accepts a Unicode text string.
  • encoding argument is newly added.
  • LISPSYS system variable controls which AutoLISP engine is used and the behavior of the function.
    • 0 - ASCII character support and no encoding argument (legacy behavior)
    • 1 or 2 - Unicode character support
0 Likes
Message 10 of 19

paullimapa
Mentor
Mentor

Thanks for that because I wasn't aware of that add.

Are you running the latest updates to your 2025 install?

https://help.autodesk.com/view/ACD/2025/ENU/?guid=AUTOCAD_2025_UPDATES

Have you tried installing 2026?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 11 of 19

vladop
Advisor
Advisor

I tried again in 2023 and now it works. I had to change yesterday because all the functions were giving an error.

0 Likes
Message 12 of 19

paullimapa
Mentor
Mentor

so most likely has to do with your 2025 install...


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 13 of 19

vladop
Advisor
Advisor

No, everything happened in the 2023 version.

0 Likes
Message 14 of 19

paullimapa
Mentor
Mentor

so what did you mean when you wrote: "...I had to change yesterday..."


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 15 of 19

vladop
Advisor
Advisor

so what did you mean when you wrote: "...I had to change yesterday..."

To remove UTF8 argument.

 

I also remembered that the other day I made a lisp that inserts blocks and there is a problem that the first time I run it after opening a new file I get an error, and then the second time I call the function it works.. It's like something is loading incorrectly. I noticed that VS CODE was reporting that a file was loading, something with - insert dwg event, I forgot exactly what it's called. I think an older version of the file was also mentioned. Maybe this has something to do with it.

0 Likes
Message 16 of 19

vladop
Advisor
Advisor

I don't have versions before 2023 installed. They used to be installed but I removed them.
It's probably time to reinstall the entire system.

 

0 Likes
Message 17 of 19

paullimapa
Mentor
Mentor

make sure you have the latest 2023 updates installed:

https://help.autodesk.com/view/ACD/2023/ENU/?guid=AUTOCAD_2023_UPDATES


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 18 of 19

vladop
Advisor
Advisor

The problem with inserting the block could be due to the file "PICK_DWGSDLGEVENTS.LSP".

 
 

Code_D0czyOhyws.png

0 Likes
Message 19 of 19

paullimapa
Mentor
Mentor

here's the link to your post in the lisp forum:

OPEN function with UTF option - Autodesk Community


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes