The default encoding in Go is UTF-8. However, when cmd.exe is run on non-Latin Windows systems, it may use an encoding other than UTF-8, which can lead to garbled text.
This patch addresses the issue by running chcp to set the code page to UTF-8 before executing commands.
Reproduce(run on a non-latin Windows):
air init
Then modify the .air.toml:
bin = "tmp\\main.exe"
cmd = "go build -o ./tmp/main.exe ."
To(leave tmp_dir alone)
bin = "bin\\main.exe"
cmd = "go build -o ./bin/main.exe ."
The default encoding in Go is UTF-8. However, when
cmd.exe
is run on non-Latin Windows systems, it may use an encoding other than UTF-8, which can lead to garbled text.This patch addresses the issue by running
chcp
to set the code page to UTF-8 before executing commands.Reproduce(run on a non-latin Windows):
Then modify the
.air.toml
:To(leave
tmp_dir
alone)Before this patch:
After: