8266774: System property values for stdout/err on Windows UTF-8

Reviewed-by: bpb, alanb
This commit is contained in:
Naoto Sato 2021-05-10 16:25:30 +00:00
parent 25d99e5267
commit c494efc5b5

View file

@ -147,6 +147,8 @@ static char* getConsoleEncoding()
cp = GetConsoleCP();
if (cp >= 874 && cp <= 950)
sprintf(buf, "ms%d", cp);
else if (cp == 65001)
sprintf(buf, "UTF-8");
else
sprintf(buf, "cp%d", cp);
return buf;