<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
On 17/06/2022 00:53, Stephanie Crater wrote:<br>
<blockquote type="cite" cite="mid:DM6PR21MB16104E5E02A7D178A38C1605A1AC9@DM6PR21MB1610.namprd21.prod.outlook.com">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style>@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;}a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}span.EmailStyle17
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-ligatures:standardcontextual;}div.WordSection1
{page:WordSection1;}ol
{margin-bottom:0in;}ul
{margin-bottom:0in;}</style>
<div class="WordSection1">
<p style="margin:0in">Hi,<o:p></o:p></p>
<p style="margin:0in"> <o:p></o:p></p>
<p style="margin:0in">I've been investigating an error on
Windows in which compilation fails when the SDK file path
includes a Chinese character (and more broadly, if any string
argument passed to java.exe contains a non-ASCII character).
This happens because command line arguments are read using
GetCommandLine() [1]. In the Windows file processenv.h, this
resolves to GetCommandLineW [2] if UNICODE is defined and
GetCommandLineA [3] otherwise. As UNICODE is not defined,
GetCommandLineA is used and Chinese characters on the command
line are converted to "?", causing the following: <o:p></o:p></p>
<p style="margin:0in">Compilation failed with an internal error.<o:p></o:p></p>
<p style="margin:0in">Exception in thread "main"
java.nio.file.InvalidPathException: Illegal char <?> at
index 34: C:\Program Files
(x86)\Android\SDK????\platforms\android-31\android.jar<o:p></o:p></p>
<p style="margin:0in"> <o:p></o:p></p>
<p style="margin:0in">This error has been reported before,
including JDK-8124977 [4] (describes command line encoding
challenges on Windows, created in 2015 and still unresolved)<br>
</p>
</div>
</blockquote>
<br>
Someone in Microsoft did propose a patch in 2015 on this. It lead to
an 8 month discussion on the issues/implications (the core-libs-dev
archive from 2015 and 2016). Several things have changed since then,
including moving to UTF-8 by default and defining system properties
for the native and console encoding. I don't disagree that it may be
time to look at this again. The core-libs-dev mailing list is the
right place rather than jdk-dev.<br>
<br>
-Alan<br>
</body>
</html>