LoginSignup
0
2

More than 1 year has passed since last update.

Visual Studio Code で バッチファイル実行時に文字化け

Last updated at Posted at 2017-08-04

Visual Studio Code で 出力が文字化けする

Ctrl+Alt+Nでバッチファイルを実行

C:\Windows>�E�rem
'�E�rem' �́A���R�}���h�܂��͊O���R�}���h�A
����”\�ȃv���O�����܂��̓o�b�` �t�@�C���Ƃ��ĔF������Ă��܂���B

C:\Windows>cls
こんにちは

        1 �‚̃t�@�C����R�s�[���܂����B


chcp コマンドをコード中に混ぜて対策してみた。

rem
cls
@echo off
chcp 65001
echo こんにちは
copy a.txt b.txt


結果、1行目の文字化けは対処できず。

C:\Windows>�E�rem
'�E�rem' �́A���R�}���h�܂��͊O���R�}���h�A
����”\�ȃv���O�����܂��̓o�b�` �t�@�C���Ƃ��ĔF������Ă��܂���B

C:\Windows>cls

Active code page: 65001
こんにちは
        1 file(s) copied.

対処方法を求むVSCODEのアップデートで解消

Excelsior!

0
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2