apache / netbeans

Apache NetBeans
https://netbeans.apache.org/
Apache License 2.0
2.64k stars 846 forks source link

Netbeans language support #6486

Open bhavinp311 opened 1 year ago

bhavinp311 commented 1 year ago

Apache NetBeans version

Apache NetBeans 19

What happened

Hello Netbeans Support, How to add language support? Please check the screenshots attached. For example: The original text is "Завантажити резюме *" but in Netbeans its showing some garbage text. Except English, all other languages show garbage text. The 1st screenshot is of Netbeans and the 2nd screenshot is of Notepad++. Just check with some non-english language text you will get to know. What to do? Hope to hear from you soon. Thanks and Regards, Bhavin. Netbeans Notepad++

How to reproduce

No response

Did this work correctly in an earlier version?

No / Don't know

Operating System

Windows 10

JDK

Version 8 Update 381 (build 1.8.0_381-b09)

Apache NetBeans packaging

Apache NetBeans platform

Anything else

No response

Are you willing to submit a pull request?

No

Chris2011 commented 1 year ago

Have you tried to open the file in UTF8?

bhavinp311 commented 1 year ago

Have you tried to open the file in UTF8?

No, I haven't open that file. Do you know the solutions?

Chris2011 commented 1 year ago

Just use this plugin and change the encoding of the opened file, if it is not already UTF-8 https://github.com/junichi11/netbeans-encoding-plugin

matthiasblaesing commented 1 year ago

@bhavinp311 please provide a minimal reproducer, that demonstrates the problem.

matthiasblaesing commented 1 year ago

@bhavinp311 Running on JDK 8 is not supported anymore. Please use a recent JDK, at least JDK 11, I suggest JDK 17 (21 is to young to be properly supported).

mbien commented 1 year ago

NetBeans 19 shouldn't be able to start on JDK 8 (#6054), so either this isn't NB 19 or it isn't running on JDK 8.

bhavinp311 commented 1 year ago

@bhavinp311 please provide a minimal reproducer, that demonstrates the problem.

Thanks for replying. Just put this text українська in .php file then close it and reopen it. I did but there is only question marks ?????. This is Ukrainin text but you can try any other text except English like Polish, Croatian, Japanese and German. Let me know if you have solution.

Thanks!

Chris2011 commented 1 year ago

@bhavinp311 please provide a minimal reproducer, that demonstrates the problem.

Thanks for replying. Just put this text українська in .php file then close it and reopen it. I did but there is only question marks ?????. This is Ukrainin text but you can try any other text except English like Polish, Croatian, Japanese and German. Let me know if you have solution.

Thanks!

Please try the solution that I already mentioned: https://github.com/apache/netbeans/issues/6486#issuecomment-1733891149

matthiasblaesing commented 1 year ago

In addition to @Chris2011 answer you should check in what project you are operating, both PHP and HTML project allow to configure a default charset.

What is missing at this point in time is support for CSS @charset rule.

For the general case I think though, that not to much work should be put into this as it seems finally most systems converge on UTF-8 as default text encoding (the JDK from 18 onwards, HTML and CSS, JS, ...), so I have some hope, that problems in that area become less of a pain point.

bhavinp311 commented 1 year ago

In addition to @Chris2011 answer you should check in what project you are operating, both PHP and HTML project allow to configure a default charset.

What is missing at this point in time is support for CSS @charset rule.

For the general case I think though, that not to much work should be put into this as it seems finally most systems converge on UTF-8 as default text encoding (the JDK from 18 onwards, HTML and CSS, JS, ...), so I have some hope, that problems in that area become less of a pain point.

In other IDEs, it works without doing extra efforts. How? Although, Netbeans is my favourite. But anyway, it's ok?

Chris2011 commented 1 year ago

No one did the effort to implement this missing feature into the core. Other IDEs have also just a loooooot more features inside the core than NetBeans. But it is as it is. the current, possible solution again is to check the plugin first. If this helps, it should be fine for now as a workaround. You can also ask the author @junichi11 to contribute this into the core. If this was the initial problem. But for now we can just guess what the problem is. Please try the solution, respond and let's see.

Chris2011 commented 1 year ago

Plugins are also fine, bringing missing features. So there is no problem at all using 3rd-party-plugins, if the feature is missing. And if the stuff is stable enough maybe the author is willing to implement this into the core. But it is up to they

bhavinp311 commented 1 year ago

Plugins are also fine, bringing missing features. So there is no problem at all using 3rd-party-plugins, if the feature is missing. And if the stuff is stable enough maybe the author is willing to implement this into the core. But it is up to they

Netbeans needs .nbm file to install any plugin and I checked the plugin you mentioned there is no such file. How to install it?

Chris2011 commented 1 year ago

Plugins are also fine, bringing missing features. So there is no problem at all using 3rd-party-plugins, if the feature is missing. And if the stuff is stable enough maybe the author is willing to implement this into the core. But it is up to they

Netbeans needs .nbm file to install any plugin and I checked the plugin you mentioned there is no such file. How to install it?

You should check the releases section: https://github.com/junichi11/netbeans-encoding-plugin/releases also inside the README.MD it is mentioned here: https://plugins.netbeans.apache.org/catalogue/?id=32

Chris2011 commented 1 year ago

@bhavinp311 did the plugin help for you?

bhavinp311 commented 11 months ago

@bhavinp311 did the plugin help for you?

Hey Chris,

Sorry, for late reply. But this plugin is not working for me. Is there any other solution?

Chris2011 commented 11 months ago

@bhavinp311 did the plugin help for you?

Hey Chris,

Sorry, for late reply. But this plugin is not working for me. Is there any other solution?

Can you please more specific by "This plugin is not working for me."? Does that mean, the plugin is not working in general or it is not a solution for your problem?

lkishalmi commented 11 months ago

Well, just tested NetBeans 20-rc3 (I do not think that it would be any different in NetBeans 19), with JDK 21, that Cyrillic alphabet is displayed correctly in NetBeans, on Linux with UTF-8.

Java changed it's default encoding to UTF-8 from JDK-18. The garbage you are seeing are UTF-8 charachters. You can set the default file encoding on windows by adding -J-Dfile.encoding=UTF-8 to the NetBeans command line arguments.

Windows has a long history using it's own codepages instead of UniCode, so that could be an issue for non-Latin alphabets.

Solution use UniCode, (UTF-8) everywhere.

lkishalmi commented 11 months ago

image image

I've took the text from here: https://r12a.github.io/scripts/tutorial/summaries/cyrillic

According to Google Translate it says: "Register now for the Tenth International Unicode Conference"

bhavinp311 commented 7 months ago

@bhavinp311 did the plugin help for you?

Hey Chris, Sorry, for late reply. But this plugin is not working for me. Is there any other solution?

Can you please more specific by "This plugin is not working for me."? Does that mean, the plugin is not working in general or it is not a solution for your problem?

Hi Chris, I still have not figured out the issue. I faced problems due to this issue. If you don't mind can you help me? We can connect over Google Meet at your preferred time. Thank you!

Chris2011 commented 7 months ago

@bhavinp311 unfortunately you didn't answer the questions. So please go step by step through it. Check the plugin and if it is not working, please describe exactly what is not working.

Also please try newest NetBeans version which is 21. And try it first with a clean user dir and without cache and wihtout any plugins. And if this is working for you, go step by step what could be the problem. Add the plugins one by one, add the cache and/or your settings. Otherwise we can't guess what your problem is.