Encoding - cmd encoding format provided under win10

  1. Outline
    1. cmd encoding format modification
  2. background
    1. I tried to modify gitbash (mingw) before the Character Set
    2. The attempt to amend the cmd encoding format
  3. ready
    1. the
      1. win10.1903

1. Review the current encoding

  1. Outline
    1. View the current default encoding cmd window
    2. Because I have not changed, so this should also be the default encoding cmd under win10
  2. step

    1. Open cmd

  3. slightly

2. Check the current coding

  1. command

    # 大写也行, 搞不懂
    > chcp
    活动代码页: 936
  2. result
    1. 936
      1. What the hell
    2. Common encodings
      1. 936
        1. GBK
      2. UTF-8
        1. 65001

2. Modify the current window encoding format

  1. Outline
    1. Modify the encoding of the current cmd window
  2. step

    1. Open cmd

  3. slightly

2. Modify the current encoding

  1. command

    > chcp 65001
    # 窗口重启
    # 重启后 第一行如下
    Active code page: 65001
  2. result
    1. Restart window
    2. The first row has prompted coding changes
    3. Enter chcp query, the results are Active code page: 65001
      1. Chinese actually do not have a
    4. Try commands

      > dir
      # 结果
      # 1. 内容正常显示
    5. Scared, and fonts are changed
      1. Change fonts
        1. gbk when the default is Arial
        2. Switch to utf-8 when Lucida Console will be replaced
      2. Why font will change it?
        1. Because Arial not fully support all of the symbol utf-8
          1. Do not change, it may be garbled
        2. So, I changed the font, to avoid embarrassment
  3. Question: Modify only control a window
    1. problem
      1. I opened the individual cmd window, then change back to the coding gbk the
      2. There is no way

3. Modify all windows

  1. Outline
    1. Try to modify the coding of all windows
  2. step

    1. Registry Editor

  3. slightly

2. Locate the entry corresponding cmd

  1. path

    计算机\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor

3. Add Configuration

  1. Right-click the Command Processor
    1. Pop-up menu
    2. select 新建 > 字符串值
  2. New Item
    1. name
      1. autorun
    2. content

      chcp 65001
  3. verification
    1. Reopen cmd
      1. Open success
      2. The first prompt 65001

ps

  1. ref
    1. How windows cmd command to restore the default code page 936
      1. It introduces the meaning of commonly used coding
    2. How to modify the cmd console default encoding is utf-8
      1. This is the win10
      2. win7 version does not apply to me, I would not be able to verify, so it does not stick out
  2. Follow-up
    1. Honestly, I do not know what I order to modify this thing
      1. Do not know, after making changes, what impact
    2. In fact, I would like to know the principles of coded display
      1. And the reasons for some of the problems
      2. Incidentally, there are solutions ...
    3. Initially hoped to understand is that network transmission, unicode related content
      1. Now how I feel farther and farther ...

Guess you like

Origin www.cnblogs.com/xy14/p/12370145.html