Skip to content

Instantly share code, notes, and snippets.

@summivox
Last active December 15, 2015 15:39
Show Gist options
  • Select an option

  • Save summivox/5283091 to your computer and use it in GitHub Desktop.

Select an option

Save summivox/5283091 to your computer and use it in GitHub Desktop.
机械设计基础A(3):AutoCAD插件 乱码修复

起因:

机设课老师发了一个叫“CAMD”的AutoCAD插件,但用AutoCAD较新版本的同学可能会遇到这个问题:

wrong

对话框全变成乱码了……

解决方法:

  1. 下载这个压缩包:http://d-h.st/hZj
  2. 打开压缩包:
    archive
  3. 解压到你放那个CAMD插件的位置(覆盖原有.dcl文件):
    target
  4. 就可以用了~
    right

我是geek分割线

原理:

虽然AutoCAD 2013可以正常读取cp936编码的lisp源码(内部转换为utf-8),但对话框定义文件.dcl却必须用 带BOM的 utf-8编码。所以:

Windows batch党再次求别黑

@echo off
mkdir dcl_old > nul
for %%f in (*.dcl) do (
    echo %%f
    copy %%f dcl_old\%%f > nul
    iconv -f cp936 -t utf-8 %%f > %%f.utf-8
    copy /Y _bom + %%f.utf-8 %%f > nul
    del %%f.utf-8 > nul
)
pause

说明:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment