[jira] [Commented] (NETBEANS-6298) Match NetBeans console encoding to system/app console encoding
[ https://issues.apache.org/jira/browse/NETBEANS-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17475029#comment-17475029 ] Thomas Schapitz commented on NETBEANS-6298: --- Ahh sorry, my bad. I was just triggered by the mentioning of the exec plugin at Jan 4th, and the console further up. You might be looking at two different different issues here. Welcome to one of Javas oldest quirks: Please take a look at this: [https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Properties.html#load(java.io.InputStream). |https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Properties.html#load(java.io.InputStream)]. Since its introduction in Java 1.2, Java properties files are specified to be encoded as ISO-8859-1. That is, unless they are written in xml (introduced with Java 1.5), or get loaded using [https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Properties.html#load(java.io.Reader).|https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Properties.html#load(java.io.Reader)], introduced with Java 1.6 In the later case, the user might in fact construct the required Reader with *any* encoding, but not necessarily the one found in system property file.encoding. But this has no power over the method using InputStream. If the property file is loaded by foreign code you can't change, you've got no chance then to comply, and encode it ISO-8859-1. And in fact, most property files get loaded this way, using [https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Class.html#getResourceAsStream(java.lang.String]) If you need to embed characters not encodable in ISO-8859-1 you would need to use proper Unicode escaping. This is a really nasty situation, as the IDE might have allowed to select a different encoding for property files, but didn't elect to; instead opted for safety & compatibility reasons to insist on ISO-8859-1 for properties files. If you can live with that, just don't use something else than ISO-8859-1 in property files. A proper remedy here is really hard to come by. Basically, it would either involve changing Javas implementation of [Properties.html#load(java.io.InputStream)|https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Properties.html#load(java.io.InputStream)] to use file.encoding, which could potentially break thousands of systems running with file.encoding set to something else, so it is rather unlikely to happen, or Netbeans to specify a separate encoding policy for properties files. This is one of the very few examples were eclipse has the upper: it allows to specify the encoding in the properties of every file. Introducing this into Netbeans will require some conviction. > Match NetBeans console encoding to system/app console encoding > -- > > Key: NETBEANS-6298 > URL: https://issues.apache.org/jira/browse/NETBEANS-6298 > Project: NetBeans > Issue Type: Bug > Components: cnd - Editor >Affects Versions: 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, NB13, 13 > Environment: Windows 10、JDK1.8.201、Maven3.6.0、Netbeans12.6、Project > encoding UTF-8 >Reporter: luke >Priority: Blocker > Attachments: Garbled.gif, Garbled.png, console-output-well.png, > full_output.png, screenshot-1.png, screenshot-2.png, screenshot-3.png > > > My Windows OS language is Simplified Chinese and the default OS encoding is > GBK. When I open a properties file or a text file, the editor shows the file > contents as garbled, if I add the parameter -J-Dfile.encoding=UTF-8, the > editor opens the file in UTF-8 encoding format and the file is not garbled, > but the console output is garbled. > !Garbled.gif|width=1055,height=536! > !Garbled.png|width=1542,height=843! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-6298) Match NetBeans console encoding to system/app console encoding
[ https://issues.apache.org/jira/browse/NETBEANS-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17472397#comment-17472397 ] luke commented on NETBEANS-6298: [~taps] I am very sorry, but for some reason I have been unable to access our website for the last few days. If only for the problem of garbled console output, although the solution is less convenient, I think the issue can be put to an end and close it. However, there seems to be another problem that I mentioned initially, which is that the properties file contains Chinese and NetBeans always opens with garbled and I have to open it in another editor to edit it, which is really inconvenient. !Garbled.gif! > Match NetBeans console encoding to system/app console encoding > -- > > Key: NETBEANS-6298 > URL: https://issues.apache.org/jira/browse/NETBEANS-6298 > Project: NetBeans > Issue Type: Bug > Components: cnd - Editor >Affects Versions: 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, NB13, 13 > Environment: Windows 10、JDK1.8.201、Maven3.6.0、Netbeans12.6、Project > encoding UTF-8 >Reporter: luke >Priority: Blocker > Attachments: Garbled.gif, Garbled.png, console-output-well.png, > full_output.png, screenshot-1.png, screenshot-2.png, screenshot-3.png > > > My Windows OS language is Simplified Chinese and the default OS encoding is > GBK. When I open a properties file or a text file, the editor shows the file > contents as garbled, if I add the parameter -J-Dfile.encoding=UTF-8, the > editor opens the file in UTF-8 encoding format and the file is not garbled, > but the console output is garbled. > !Garbled.gif|width=1055,height=536! > !Garbled.png|width=1542,height=843! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-6298) Match NetBeans console encoding to system/app console encoding
[ https://issues.apache.org/jira/browse/NETBEANS-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17470276#comment-17470276 ] Thomas Schapitz commented on NETBEANS-6298: --- NETBEANS-4595 and NETBEANS-6298 are related, in that both are concerning the execution environment of a java process, that has been spawned via Netbeans -> Maven -> exec-maven-plugin:exec. Users seem to expect, that the spawned process seamlessly inherits the execution settings of Netbeans - but this may only be achieved by explicitly configuring it in an non-obvious way. Considerable part of this is caused by limits imposed by exec-maven-plugin:exec, which isn't even hosted within apache.org > Match NetBeans console encoding to system/app console encoding > -- > > Key: NETBEANS-6298 > URL: https://issues.apache.org/jira/browse/NETBEANS-6298 > Project: NetBeans > Issue Type: Bug > Components: cnd - Editor >Affects Versions: 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, NB13, 13 > Environment: Windows 10、JDK1.8.201、Maven3.6.0、Netbeans12.6、Project > encoding UTF-8 >Reporter: luke >Priority: Blocker > Attachments: Garbled.gif, Garbled.png, console-output-well.png, > full_output.png, screenshot-1.png, screenshot-2.png, screenshot-3.png > > > My Windows OS language is Simplified Chinese and the default OS encoding is > GBK. When I open a properties file or a text file, the editor shows the file > contents as garbled, if I add the parameter -J-Dfile.encoding=UTF-8, the > editor opens the file in UTF-8 encoding format and the file is not garbled, > but the console output is garbled. > !Garbled.gif|width=1055,height=536! > !Garbled.png|width=1542,height=843! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-6298) Match NetBeans console encoding to system/app console encoding
[ https://issues.apache.org/jira/browse/NETBEANS-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17470269#comment-17470269 ] Thomas Schapitz commented on NETBEANS-6298: --- Could we then close this Bug as 'invalid'? As this, in my opinion, turned out as just another - justifiable- quirk of the exec-maven-plugin usage, which could be addressed in the project properties, as well in the exec-plugins configuration in pom.xml? I know, that it may be considered inconvenient, that one might need do do this in order to get the proper execution environment. But options to be set for the requirements for the process spawned by the exec plugin might indeed change, depending on whether you invoke your maven build directly, from an OS shell, via NB run command, or within a CI system like travis or jenkins. It might also be depending on the started executable itself, which might have hardcoded the encoding for output on sysout and syserr. None of the participants within the chain of delegation (Netbeans -> Maven -> the exec-plugin) have a viable way of predicting these requirements. If Netbeans was to introduce mechanisms to twist the defaults there, matters would only get worse. The more, since in this case, there are also differences across the OSes to consider. Note, that I'm having a similar discussion regarding the exec-plugin, its use of PATH, and the selected Java executable in NETBEANS-4595. > Match NetBeans console encoding to system/app console encoding > -- > > Key: NETBEANS-6298 > URL: https://issues.apache.org/jira/browse/NETBEANS-6298 > Project: NetBeans > Issue Type: Bug > Components: cnd - Editor >Affects Versions: 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, NB13, 13 > Environment: Windows 10、JDK1.8.201、Maven3.6.0、Netbeans12.6、Project > encoding UTF-8 >Reporter: luke >Priority: Blocker > Attachments: Garbled.gif, Garbled.png, console-output-well.png, > full_output.png, screenshot-1.png, screenshot-2.png, screenshot-3.png > > > My Windows OS language is Simplified Chinese and the default OS encoding is > GBK. When I open a properties file or a text file, the editor shows the file > contents as garbled, if I add the parameter -J-Dfile.encoding=UTF-8, the > editor opens the file in UTF-8 encoding format and the file is not garbled, > but the console output is garbled. > !Garbled.gif|width=1055,height=536! > !Garbled.png|width=1542,height=843! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-6298) Match NetBeans console encoding to system/app console encoding
[ https://issues.apache.org/jira/browse/NETBEANS-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17468322#comment-17468322 ] luke commented on NETBEANS-6298: [~almson] I'm very sorry, I've been busy at work recently and I couldn't get back to you in time. I tried again as you described and the console output was not garbled and it worked. !console-output-well.png! > Match NetBeans console encoding to system/app console encoding > -- > > Key: NETBEANS-6298 > URL: https://issues.apache.org/jira/browse/NETBEANS-6298 > Project: NetBeans > Issue Type: Bug > Components: cnd - Editor >Affects Versions: 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, NB13, 13 > Environment: Windows 10、JDK1.8.201、Maven3.6.0、Netbeans12.6、Project > encoding UTF-8 >Reporter: luke >Priority: Blocker > Attachments: Garbled.gif, Garbled.png, console-output-well.png, > full_output.png, screenshot-1.png, screenshot-2.png, screenshot-3.png > > > My Windows OS language is Simplified Chinese and the default OS encoding is > GBK. When I open a properties file or a text file, the editor shows the file > contents as garbled, if I add the parameter -J-Dfile.encoding=UTF-8, the > editor opens the file in UTF-8 encoding format and the file is not garbled, > but the console output is garbled. > !Garbled.gif|width=1055,height=536! > !Garbled.png|width=1542,height=843! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-6298) Match NetBeans console encoding to system/app console encoding
[ https://issues.apache.org/jira/browse/NETBEANS-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17464353#comment-17464353 ] Aleksandr Dubinsky commented on NETBEANS-6298: -- [~randyluke] I don't see {{-Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8}} being applied. You can also try to set them with the Yellow Re-Run button. !screenshot-1.png! !screenshot-2.png! !screenshot-3.png! > Match NetBeans console encoding to system/app console encoding > -- > > Key: NETBEANS-6298 > URL: https://issues.apache.org/jira/browse/NETBEANS-6298 > Project: NetBeans > Issue Type: Bug > Components: cnd - Editor >Affects Versions: 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, NB13, 13 > Environment: Windows 10、JDK1.8.201、Maven3.6.0、Netbeans12.6、Project > encoding UTF-8 >Reporter: luke >Priority: Blocker > Attachments: Garbled.gif, Garbled.png, full_output.png, > screenshot-1.png, screenshot-2.png, screenshot-3.png > > > My Windows OS language is Simplified Chinese and the default OS encoding is > GBK. When I open a properties file or a text file, the editor shows the file > contents as garbled, if I add the parameter -J-Dfile.encoding=UTF-8, the > editor opens the file in UTF-8 encoding format and the file is not garbled, > but the console output is garbled. > !Garbled.gif|width=1055,height=536! > !Garbled.png|width=1542,height=843! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-6298) Match NetBeans console encoding to system/app console encoding
[ https://issues.apache.org/jira/browse/NETBEANS-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17463887#comment-17463887 ] luke commented on NETBEANS-6298: [~almson] Here is the entire output: !full_output.png! > Match NetBeans console encoding to system/app console encoding > -- > > Key: NETBEANS-6298 > URL: https://issues.apache.org/jira/browse/NETBEANS-6298 > Project: NetBeans > Issue Type: Bug > Components: cnd - Editor >Affects Versions: 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, NB13, 13 > Environment: Windows 10、JDK1.8.201、Maven3.6.0、Netbeans12.6、Project > encoding UTF-8 >Reporter: luke >Priority: Blocker > Attachments: Garbled.gif, Garbled.png, full_output.png > > > My Windows OS language is Simplified Chinese and the default OS encoding is > GBK. When I open a properties file or a text file, the editor shows the file > contents as garbled, if I add the parameter -J-Dfile.encoding=UTF-8, the > editor opens the file in UTF-8 encoding format and the file is not garbled, > but the console output is garbled. > !Garbled.gif|width=1055,height=536! > !Garbled.png|width=1542,height=843! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-6298) Match NetBeans console encoding to system/app console encoding
[ https://issues.apache.org/jira/browse/NETBEANS-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17463787#comment-17463787 ] Aleksandr Dubinsky commented on NETBEANS-6298: -- It'd be helpful to see the entire output, including Maven Exec parameters. The console encoding is mismatched. The application is using "x-mswin-936" while Netbeans terminal is using UTF-8. The sun.*.encoding VM options should have an effect, and did for me. Not sure what you're doing wrong. It would be an easy fix to get the Netbeans console to use the system encoding. Hopefully some of the devs take notice. > Match NetBeans console encoding to system/app console encoding > -- > > Key: NETBEANS-6298 > URL: https://issues.apache.org/jira/browse/NETBEANS-6298 > Project: NetBeans > Issue Type: Bug > Components: cnd - Editor >Affects Versions: 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, NB13, 13 > Environment: Windows 10、JDK1.8.201、Maven3.6.0、Netbeans12.6、Project > encoding UTF-8 >Reporter: luke >Priority: Blocker > Attachments: Garbled.gif, Garbled.png > > > My Windows OS language is Simplified Chinese and the default OS encoding is > GBK. When I open a properties file or a text file, the editor shows the file > contents as garbled, if I add the parameter -J-Dfile.encoding=UTF-8, the > editor opens the file in UTF-8 encoding format and the file is not garbled, > but the console output is garbled. > !Garbled.gif|width=1055,height=536! > !Garbled.png|width=1542,height=843! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-6298) Match NetBeans console encoding to system/app console encoding
[ https://issues.apache.org/jira/browse/NETBEANS-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17462720#comment-17462720 ] luke commented on NETBEANS-6298: @[~almson] Yes, the console output is garbled. Here is the output(copyed from the console output): x-mswin-936 ڧӧ֧� Unicode BUILD SUCCESS > Match NetBeans console encoding to system/app console encoding > -- > > Key: NETBEANS-6298 > URL: https://issues.apache.org/jira/browse/NETBEANS-6298 > Project: NetBeans > Issue Type: Bug > Components: cnd - Editor >Affects Versions: 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, NB13, 13 > Environment: Windows 10、JDK1.8.201、Maven3.6.0、Netbeans12.6、Project > encoding UTF-8 >Reporter: luke >Priority: Blocker > Attachments: Garbled.gif, Garbled.png > > > My Windows OS language is Simplified Chinese and the default OS encoding is > GBK. When I open a properties file or a text file, the editor shows the file > contents as garbled, if I add the parameter -J-Dfile.encoding=UTF-8, the > editor opens the file in UTF-8 encoding format and the file is not garbled, > but the console output is garbled. > !Garbled.gif|width=1055,height=536! > !Garbled.png|width=1542,height=843! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-6298) Match NetBeans console encoding to system/app console encoding
[ https://issues.apache.org/jira/browse/NETBEANS-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17462705#comment-17462705 ] Aleksandr Dubinsky commented on NETBEANS-6298: -- [~randyluke] Have you tried to set `-J-Dfile.encoding=UTF-8` in netbeans.conf and `-Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8` (without -J) in VM Options? > Match NetBeans console encoding to system/app console encoding > -- > > Key: NETBEANS-6298 > URL: https://issues.apache.org/jira/browse/NETBEANS-6298 > Project: NetBeans > Issue Type: Bug > Components: cnd - Editor >Affects Versions: 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, NB13, 13 > Environment: Windows 10、JDK1.8.201、Maven3.6.0、Netbeans12.6、Project > encoding UTF-8 >Reporter: luke >Priority: Blocker > Attachments: Garbled.gif, Garbled.png > > > My Windows OS language is Simplified Chinese and the default OS encoding is > GBK. When I open a properties file or a text file, the editor shows the file > contents as garbled, if I add the parameter -J-Dfile.encoding=UTF-8, the > editor opens the file in UTF-8 encoding format and the file is not garbled, > but the console output is garbled. > !Garbled.gif|width=1055,height=536! > !Garbled.png|width=1542,height=843! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists
[jira] [Commented] (NETBEANS-6298) Match NetBeans console encoding to system/app console encoding
[ https://issues.apache.org/jira/browse/NETBEANS-6298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17462362#comment-17462362 ] luke commented on NETBEANS-6298: @[~almson] I tried your code and this is the result (in version 12.6): If I add the "-J-Dfile.encoding=UTF-8" option to the netbeans.conf file, the console output is always garbled, if the netbeans.conf file without the "-J-Dfile.encoding=UTF-8" option, regardless of "-J-Dsun.stdout.encoding=UTF-8 -J-Dsun.stderr.encoding=UTF-8 " option exists or not (netbeans.conf or run VM Options), the console output will not be garbled. Also, opening the properties file (UTF-8 encoding) is always garbled unless I set this properties file property separately (Right click properties file > propties) and check the "Use project encoding" option. There are two problems with this: 1. If I have a lot of propties files, it is bad to set each one; 2. If my project encoding is GBK or some other encoding that does not match the encoding of the propties file, then I will always get garbled no matter how I open the propties file. > Match NetBeans console encoding to system/app console encoding > -- > > Key: NETBEANS-6298 > URL: https://issues.apache.org/jira/browse/NETBEANS-6298 > Project: NetBeans > Issue Type: Bug > Components: cnd - Editor >Affects Versions: 12.0, 12.1, 12.2, 12.3, 12.4, 12.5, 12.6, NB13, 13 > Environment: Windows 10、JDK1.8.201、Maven3.6.0、Netbeans12.6、Project > encoding UTF-8 >Reporter: luke >Priority: Blocker > Attachments: Garbled.gif, Garbled.png > > > My Windows OS language is Simplified Chinese and the default OS encoding is > GBK. When I open a properties file or a text file, the editor shows the file > contents as garbled, if I add the parameter -J-Dfile.encoding=UTF-8, the > editor opens the file in UTF-8 encoding format and the file is not garbled, > but the console output is garbled. > !Garbled.gif|width=1055,height=536! > !Garbled.png|width=1542,height=843! -- This message was sent by Atlassian Jira (v8.20.1#820001) - To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists