如何在windows的DOS窗口中正常顯示中文(UTF-8字符)

打開CMD.exe命令行窗口,經過 chcp命令改變代碼頁命令行

UTF-8的代碼頁爲65001,ANSI/OEM - 簡體中文 GBK爲936,window default OEM - 美國爲437code

若是chcp命令獲得437,那麼必定不能顯示中文,此時的中文爲???.若是是亂碼,那麼必定字符碼不是UTF-8blog

refer to http://zfj-rails.iteye.com/blog/778022ci


    * 437 — The original IBM PC code page
    * 932 — Supports Japanese
    * 936 — GBK Supports Simplified Chinese
    * 949 — Supports Korean
    * 950 — Supports Traditional Chinese
    * 1200 — UTF-16LE Unicode little-endian
    * 1201 — UTF-16BE Unicode big-endian
    * 65000 — UTF-7 Unicode
    * 65001 — UTF-8 Unicode
    * 10000 — Macintosh Roman encoding (followed by several other Mac character sets)
    * 10007 — Macintosh Cyrillic encoding
    * 10029 — Macintosh Central European encoding
    * 20127 — US-ASCII The classic US 7 bit character set with no char larger than 127
    * 28591 — ISO-8859-1 (followed by ISO-8859-2 to ISO-8859-15)cmd

使用chcp 936在CMD.exe命令行窗口。it

也能夠該註冊表,在開始運行裏輸入regedit  找到分支 HKEY_CURRENT_USER/Console/%SystemRoot%_system32_cmd.exe,再雙擊右邊CodePage選項將數值改成十六進制3a8或十進制"936io

十六進制"000003a8"或十進制"936",表示「936 (ANSI/OEM - 簡體中文 GBK)」。
十六進制"000001b5"或十進制"437",表示「437 (OEM - 美國)」。class

相關文章
相關標籤/搜索