netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Netbeans language support

Open bhavinp311 opened this issue 2 years ago • 21 comments

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

bhavinp311 avatar Sep 25 '23 06:09 bhavinp311

Have you tried to open the file in UTF8?

Chris2011 avatar Sep 25 '23 10:09 Chris2011

Have you tried to open the file in UTF8?

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

bhavinp311 avatar Sep 25 '23 13:09 bhavinp311

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

Chris2011 avatar Sep 25 '23 14:09 Chris2011

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

matthiasblaesing avatar Sep 25 '23 17:09 matthiasblaesing

@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).

matthiasblaesing avatar Sep 25 '23 17:09 matthiasblaesing

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.

mbien avatar Sep 25 '23 23:09 mbien

@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!

bhavinp311 avatar Sep 26 '23 11:09 bhavinp311

@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

Chris2011 avatar Sep 26 '23 13:09 Chris2011

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.

matthiasblaesing avatar Sep 26 '23 19:09 matthiasblaesing

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?

bhavinp311 avatar Sep 27 '23 08:09 bhavinp311

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 avatar Sep 27 '23 08:09 Chris2011

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

Chris2011 avatar Sep 27 '23 08:09 Chris2011

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?

bhavinp311 avatar Sep 27 '23 11:09 bhavinp311

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 avatar Sep 27 '23 11:09 Chris2011

@bhavinp311 did the plugin help for you?

Chris2011 avatar Oct 01 '23 16:10 Chris2011

@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?

bhavinp311 avatar Nov 01 '23 13:11 bhavinp311

@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?

Chris2011 avatar Nov 01 '23 14:11 Chris2011

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 avatar Nov 04 '23 16:11 lkishalmi

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"

lkishalmi avatar Nov 04 '23 16:11 lkishalmi

@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!

bhavinp311 avatar Feb 28 '24 14:02 bhavinp311

@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.

Chris2011 avatar Mar 01 '24 21:03 Chris2011