newer 发表于 2021-1-26 18:45:44

在DCL文件中使用UNICODE字符

Using Unicode characters in DCL filesBy Adam NagySome 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:https://adndevblog.typepad.com/.a/6a0167607c2431970b017ee8837493970d-320wi








huangpc27 发表于 2021-1-27 08:33:45

英文看不懂

wzjck01 发表于 2021-6-24 17:47:18

学习,学习。

每人皆师 发表于 2023-9-6 12:56:23

在DCL文件中使用Unicode字符

作者: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的命令,该命令将打开一个对话框。如果它看起来完全像这样,那么一切都很好:
页: [1]
查看完整版本: 在DCL文件中使用UNICODE字符