1. Perl
  2. Windows

Display UTF - 8 characters at the command prompt

It seems that the characters cannot be drawn correctly with this method. (maeyan's article).

It didn't work in my environment either.

Procedure

  1. Command prompt font change
  2. Change the character code of the command prompt
  3. Automatically set the character code from the shortcut.

Windows version

It was done with Windows XP Home Edition Version 2002 Service Pack 2.

1. Change command prompt font

Launch Command Prompt → Right click on title bar
Select "MS Gothic" from → Properties → Font.

Change the font to "MS Gothic". MS Gothic does not display all Unicode-enabled characters correctly, but it does support Unicode. Characters including Japanese and decorative characters can be displayed.

2. Change the character code of the command prompt

# Change to UTF-8
chcp 65001

# When returning to the original character code (default)
chcp 932

# When checking the character code
chcp

To change the character code of the command prompt to UTF-8, use chcp 65001. There seems to be a bug in this mode change, which makes it impossible to set the command prompt from the properties (MS Gothic cannot be selected).

To change the command prompt settings from the properties, return to the original character code as chcp 932 and then make the changes.

3. Automatically set the character code from the shortcut

Right-click the shortcut icon at the command prompt → Shortcut
Link destination
%SystemRoot%\system32\cmd.exe /f: on/k "chcp 65001"
Set to.

If it is troublesome to change the character code every time, it will be automated./k describes the command you want to execute at the command prompt and at run time./f: on is a file completion function.

Related Informatrion