duoduobingbing commented on code in PR #4396:
URL: https://github.com/apache/netbeans/pull/4396#discussion_r923672934
##########
ide/extexecution.base/src/org/netbeans/api/extexecution/base/BaseExecutionService.java:
##########
@@ -140,6 +140,45 @@ public static BaseExecutionService newService(@NonNull
Callable<? extends Proces
return new BaseExecutionService(processCreator, descriptor);
}
+ /**
+ * Infers the output encoding from the relevant system properties, if
those should all be <code>null</code>
+ * then this will fallback to <code>Charset.defaultCharset()</code>
+ *
+ * Since JDK 18 and JEP400 Console.charset() is used for the console's
encoding instead of <code>Charset.defaultCharset()</code>.
+ * Console.charset() is exposed via stdout.encoding/sun.stdout.encoding.
+ * If ran with JDK<=16 stdout.encoding and native.encoding should be null
and the old default of <code>Charset.defaultCharset()</code> will be used to
match pre JEP400 behavior.
+ *
+ * The checking order for the encoding is stdout.encoding,
sun.stdout.encoding, native.encoding, <code>Charset.defaultCharset()</code>
+ *
+ * @see
org.netbeans.modules.maven.execute.CommandLineOutputHandler#getPreferredCharset
+ *
+ * @return inferred encoding as Charset
+ */
+ private static Charset getInputOutputEncoding(){
+ String[] encodingSystemProperties = new String[]{"stdout.encoding,
sun.stdout.encoding, native.encoding"};
Review Comment:
How embarrassing that I missed this during cleanup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists