[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
回复 1# ckz1211

Win10 測試OK
  1. ::先輸出一個Unicode檔案
  2. reg  export  HKCR\.txt  U.bom
  3. ::取得 Unicode BOM
  4. chcp 1252
  5. set /p BOM=<U.bom
  6. set /p=%BOM:~0,2%<nul  >U.bom
  7. ::ansi → Unicode
  8. chcp 936
  9. copy  U.bom  Unicode.txt
  10. cmd /u /c "type ansi.txt >>Unicode.txt"
  11. ::=======================================
  12. chcp 65001
  13. ::Unicode → 無BOM的UTF-8
  14. type Unicode.txt > UTF-8-0.txt
  15. ::Unicode → 有BOM的UTF-8
  16. copy /b U.bom + Unicode.txt  Unicode-2B.txt
  17. type Unicode-2B.txt > UTF-8-B.txt
  18. ::=======================================
  19. ::無BOM的UTF-8 → Unicode
  20. copy  U.bom  Unicode-save-0.txt
  21. cmd /u /c  "type  UTF-8-0.txt >> Unicode-save-0.txt"
  22. ::有BOM的UTF-8 → Unicode
  23. cmd /u /c  "type  UTF-8-B.txt > Unicode-save-1.txt"
  24. ::========================================
  25. ::Unicode → ansi
  26. chcp 936
  27. type Unicode-save-0.txt > ansi-save-0.txt
  28. type Unicode-save-1.txt > ansi-save-1.txt
复制代码
3

评分人数

TOP

返回列表