Skip to content

Commit

Permalink
bat: Use utf8 codepage
Browse files Browse the repository at this point in the history
Fixes #1459
  • Loading branch information
1480c1 committed Nov 4, 2019
1 parent 07020d1 commit 6e4d4ba
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions media-autobuild_suite.bat
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ color 70
title media-autobuild_suite

setlocal
chcp 65001
cd /d "%~dp0"
set "TERM=xterm-256color"
setlocal
Expand Down

2 comments on commit 6e4d4ba

@God-damnit-all
Copy link
Contributor

@God-damnit-all God-damnit-all commented on 6e4d4ba Nov 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately there's a lot of bugs surrounding chcp 65001. https://dev.to/mattn/please-stop-hack-chcp-65001-27db

And this one might appear to just be powershell related, but it seems to manifest itself with launching msys2 too (as well as other shells): microsoft/terminal#280

Your best best is to query the native codepage and save that to a variable, then only invoking 65001 just before launching mintty.exe. This might work:

for /f "tokens=3" %%G in ('reg query HKLM\SYSTEM\CurrentControlSet\Control\Nls\CodePage /v OEMCP')^
    do set oemcp=%%G
chcp 65001 >NUL
start /I /WAIT %instdir%\%msys2%\usr\bin\mintty.exe -d -i /msys2.ico^
    --log 2>&1 %build%\%log% /usr/bin/bash -lc "%command% %arg%"^
    & chcp %oemcp% >NUL

@wiiaboo
Copy link
Member

@wiiaboo wiiaboo commented on 6e4d4ba Nov 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A more sane fix for this would be just disregarding the user and make it a fixed ab-suite user. Would allow us to sandbox our user settings and mess around a bit more with them.

Please sign in to comment.