Fix visual_studio.py to call vswhere with -utf8 (#32949)

In Japanese Windows, `vswhere` puts cp932 string in default and fails to
load json in Pyhton.
This fixes it by adding `-utf8` option

Signed-off-by: hatoo <hato2000@gmail.com>
This commit is contained in:
hatoo 2024-08-06 18:35:05 +09:00 committed by GitHub
parent 3f339d6856
commit 28430bad0e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -57,7 +57,8 @@ def find_compatible_msvc_with_vswhere() -> Generator[VisualStudioInstallation, N
'-format', 'json',
'-products', '*',
'-requires', 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
'-requires', 'Microsoft.VisualStudio.Component.Windows10SDK'
'-requires', 'Microsoft.VisualStudio.Component.Windows10SDK',
'-utf8'
]).decode(errors='ignore')
for install in json.loads(output):