找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1638|回复: 3

[其他] 在DCL文件中使用UNICODE字符

[复制链接]

已领礼包: 40个

财富等级: 招财进宝

发表于 2021-1-26 18:45:44 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
Using Unicode characters in DCL files[size=1.2em]
Some people experienced issues with their DCL files when using them in AutoCAD 2013. Their unicode characters (Cyrillic, Greek, etc.) were not displayed correctly. DCL files by default are saved in ANSI format where the characters depend on the code page being used. In previous versions the character set selection when dispaying the DCL dialogs was based on the OS settings, whereas in the new version it is based on the language version of AutoCAD. This change in behaviour is likely to be reverted.
To avoid this problem you can update your DCL file to UTF-8 format which does not depend on codepages, product language version or OS settings.
Note: UTF-8 DCL files can only be used from AutoCAD 2013 onwards.
To make your DCL file use the UTF-8 format, simply open it in Notepad, then in the Save As dialog set Encoding to UTF-8. Note that Visual Lisp editor doesn't show UTF-8 files properly, so you'll have to edit those in a unicode compatible editor such as Notepad.
I also tested using the UTF-8 DCL file inside a Visual Lisp Application that can be compiled into a VLX file. There are many posts on the net about creating a Visual Lisp Application.
Once I compiled the application (File >> Make Application >> Make Application) then I got the VLX file that I could APPLOAD into AutoCAD. The attached sample application includes a command called TestDcl, which should bring up a dialog. If it looks exactly like this then all is fine:







vlxtest.zip (2.07 KB, 下载次数: 17)
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 675个

财富等级: 财运亨通

发表于 2021-1-27 08:33:45 | 显示全部楼层
英文看不懂
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 14个

财富等级: 恭喜发财

发表于 2021-6-24 17:47:18 | 显示全部楼层
学习,学习。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复

使用道具 举报

发表于 2023-9-6 12:56:23 | 显示全部楼层
在DCL文件中使用Unicode字符[size=1.2em]

作者:Adam Nagy

有些人在AutoCAD 2013中使用DCL文件时遇到问题。他们的unicode字符(西里尔字母、希腊字母等)没有正确显示。默认情况下,DCL文件以ANSI格式保存,其中的字符取决于所使用的代码页。在以前的版本中,显示DCL对话框时的字符集选择基于操作系统设置,而在新版本中,它基于AutoCAD的语言版本。这种行为上的改变很可能会逆转。

为了避免此问题,您可以将DCL文件更新为UTF-8格式,该格式不依赖于代码页、产品语言版本或操作系统设置。

注意:UTF-8 DCL文件只能在AutoCAD 2013以后的版本中使用。

要使DCL文件使用UTF-8格式,只需在记事本中打开它,然后在“另存为”对话框中将“编码”设置为UTF-8。请注意,Visual Lisp编辑器无法正确显示UTF-8文件,因此您必须在兼容unicode的编辑器(如记事本)中编辑这些文件。

我还在Visual Lisp应用程序中使用UTF-8 DCL文件进行了测试,该应用程序可以编译成VLX文件。网上有很多关于创建Visual Lisp应用程序的帖子。

编译应用程序后(“文件”>>“生成应用程序”>>“制作应用程序”),我得到了可以APPLOAD到AutoCAD中的VLX文件。所附的示例应用程序包括一个名为TestDcl的命令,该命令将打开一个对话框。如果它看起来完全像这样,那么一切都很好:
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-4-29 15:38 , Processed in 0.184691 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表