回复 1# ckz1211
Win10 測試OK- ::先輸出一個Unicode檔案
- reg export HKCR\.txt U.bom
-
- ::取得 Unicode BOM
- chcp 1252
- set /p BOM=<U.bom
- set /p=%BOM:~0,2%<nul >U.bom
-
- ::ansi → Unicode
- chcp 936
- copy U.bom Unicode.txt
- cmd /u /c "type ansi.txt >>Unicode.txt"
-
- ::=======================================
-
- chcp 65001
-
-
- ::Unicode → 無BOM的UTF-8
- type Unicode.txt > UTF-8-0.txt
-
-
- ::Unicode → 有BOM的UTF-8
- copy /b U.bom + Unicode.txt Unicode-2B.txt
- type Unicode-2B.txt > UTF-8-B.txt
-
- ::=======================================
- ::無BOM的UTF-8 → Unicode
- copy U.bom Unicode-save-0.txt
- cmd /u /c "type UTF-8-0.txt >> Unicode-save-0.txt"
-
-
- ::有BOM的UTF-8 → Unicode
- cmd /u /c "type UTF-8-B.txt > Unicode-save-1.txt"
-
- ::========================================
- ::Unicode → ansi
-
- chcp 936
-
- type Unicode-save-0.txt > ansi-save-0.txt
-
- type Unicode-save-1.txt > ansi-save-1.txt
复制代码
|