1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

UTF-8でファイルを保存するバッチ

Posted at

#説明
###chcp 65001実行前
utf-8で出力されファイル形式も同様

###chcp 65001実行後
文字化けする

exec.bat
@echo off

set INPUT1=この文字は文字化けしない

@REM utf-8表示
chcp 65001

set INPUT2=この文字は文字化けする

echo INPUT1>>utf-8.txt
echo INPUT2>>sjis.txt


pause
utf-8.txt(utf8)
この文字は文字化けしない
sjis.txt(sjis)
縺薙?譁?ュ励?譁?ュ怜喧縺代☆繧
1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?