RFR 8124977 cmdline encoding challenges on Windows

Xueming Shen xueming.shen at oracle.com
Sat Jul 11 18:50:31 UTC 2015


Hi Kirk,

Two questions

(1) Why do you need to change the "encoding" used by the java.io.Console 
class. My understanding
      is that the console encoding is specifically used to "talk" to the 
underlying terminal, it should just
      be the one used by the underlying terminal/console. I don't think 
the proposed change updates
      the underlying console encoding (something like chcp)  when 
-Dwindows.UnicodeConsole=true
      specified, if I read the webrev correctly. Instead, the 
Java_java_io_Console_encoding() probably
      need to be updated to return utf8 if the cp == 65001, so if the 
underlying terminal/console is
      using cp65001, the java.io.Console should encode/decode in utf8.
      I would assume the encoding of java.io.Condole should have nothing 
to do with using
      GetCommandLIneW() to parse the arguments in unicode in launcher?

(2) Why do you need a defaultUnicodeCharset() in Charset class? Seems to 
me the scope should/could
      be limited inside LauncherHelper.java?

Thanks,
-Sherman


On 7/8/15 9:50 AM, Kirk Shoop wrote:
>> -----Original Message-----
>> From: Kumar Srinivasan [mailto:kumar.x.srinivasan at oracle.com]
>>
>> Hi Kirk,
>>
>> Thanks for proposing this change.
>>
>> If you notice all the posix calls are wrapped in JLI_* this  gives us the
>> ability to use "W" functions.  I almost got it done, several years ago,
>> but we upgraded to VS2010 and my work based on VS2003 keeled over,
>> meanwhile my focus was  "shifted" to something else.
>>
>> main.c: is really envisioned to be a stub  compiled by the tool launchers,
>> like java, javac, javah, jar etc. I prefer to see all the heavy logic in
>> this file moved to the platform specific file windows/java_md.*
>>
> Heavy logic is moved out of main.c file.
>
>> For the reason specified above we need to move fprintf or any naked posix
>> calls to JLI_* indirections.
>>
> Posix calls are wrapped in JLI_* functions.
>
>> I don't see any tests ? The tests must be written in java and placed in
>> jdk/test/tools/launcher, there is a helper framework TestHelper.java.
>>
> A new test for our changes is added.
>
>> There are other changes in nio, charsets etc, this will be reviewed by my
>> colleague specializing in that area (Sherman) cc'ed.
>>
>>
>> Thanks
>>
>> Kumar
> Thank you for the feedback!
>
> Valery prepared a new webrev which I placed here:
>    http://cr.openjdk.java.net/~kshoop/8124977/webrev.01
>
> Thanks,
> Kirk




More information about the core-libs-dev mailing list