LibreCAD / libdxfrw

Successor of https://sourceforge.net/projects/libdxfrw/, developed for LibreCAD, by LibreCAD Contributors, usable for all
GNU General Public License v2.0
187 stars 71 forks source link

Garbled code read dwg #76

Open 8502596 opened 6 months ago

8502596 commented 6 months ago

I know the encoding of this dwg file is in GBK or gb2312 ,But I cannot export dxf (v2007) correctly using the program, and I cannot even export any version correctly. It is interesting that using AutoCAD can correctly export UTF-8 format dxf without garbled text. Please help me!In fact, aspose.cad provides a Java/. net version for exporting dxf files, but its format can only be exported as dxf-R12 version. I want dxf-v2007 version or higher to support gbk (Chinese).

It is very interesting that the converted dxf file cannot be opened by AutoCAD software, but can be opened by third-party software as follows. I guess when reading in, I should use GBK to read dwg and write in dxf (v2007), I should use UTF-8 to write in, so he needs a conversion, but I don't know how to modify it

image

The Test File a-43.zip

ferrellsl commented 6 months ago

I can't open your zip file. My systems says it's corrupted.

8502596 commented 6 months ago

sorry Actually, his format is rar. You can use WinRAR to open it. In the Windows environment, I thought you needed to test the AutoCAD conversion file in the Windows environment. this is zip file a-43.zip and The software is 360 compression, but it should be able to be opened with 7z

8502596 commented 6 months ago

You can use AutoCAD to open and convert to dxf (v2007) and above versions.AutoCAD can open converted dxf files. but After converting through the program, you will find that AutoCAD cannot open the converted dxf file. I think the problem lies in the coding

ferrellsl commented 6 months ago

It opens just fine in AutoCAD 2022. I was asked to supply a font SHX file upon opening as the original doesn't exist on my system. I just chose the first available font (@extfont2.shx) and this is the result. image

ferrellsl commented 6 months ago

Here are the DWG and DXF from AutoCAD 2022 in ZIP format. a-43-encoding.zip

8502596 commented 6 months ago

您说的这些 都是我知道的 我知道autocad 可以正常打开测试的文件以及导出。但如何通过libdxfrw 程序做到这一点?我通过另外一个开源项目cad2x封装了libdxfrw 也可以正常导出dxf 但导出的dxf 文件 用autocad 打不开,里面关于文字是乱码 ,可以根据第三方软件去打开 What you said is all I know. I know that AutoCAD can open test files and export them normally. But how can we achieve this through the libdxfrw program? I encapsulated libdxfrw through another open-source project, cad2x, and it can also export dxf normally. However, the exported dxf file cannot be opened using AutoCAD, and the text inside is garbled. It can be opened using third-party software 浩辰CAD a-43.zip dwg2dxf.zip cad2x.zip a-43-dxf.zip

ferrellsl commented 6 months ago

It appears to be related to this other open issue: https://github.com/LibreCAD/libdxfrw/issues/17