bpo-32409: Ensures activate.bat can handle Unicode contents by zooba · Pull Request #5757 · python/cpython

This does not work on German systems:

We had to revert to Python 3.6, because of this as it will not work on German (or Swiss German) Windows systems:

activate.bat breaks on German systems as chcp does not return a plain number. Note the dot at the end:

chcp
Aktive Codepage: 850.

This leads to

for /F "tokens=2 delims=:" %a in ('"C:\WINDOWS\System32\chcp.com"') do (echo "%a" )
(echo " 850." )
" 850."

Fortunately it is easy to extract the number from there

for /f "tokens=2 delims=:" %%a in ('"%SystemRoot%\System32\chcp.com"') do (
echo "%%a"
for %%F in ("%%a") do set "_OLD_CODEPAGE=%%~nxF"
echo %_OLD_CODEPAGE%
)