netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

Can not write utf-8 on Netbeans 14

Open s1mpleluluvn opened this issue 2 years ago • 10 comments

Apache NetBeans version

Apache NetBeans 14

What happened

I use Vietnamese Keyboard (https://www.unikey.org) and coding. When i write "thế giới" it change to "th? gi?i". But when i copy "thế giới" from another editor it working fine. It happen since netbeans 13-14.

How to reproduce

No response

Did this work correctly in an earlier version?

Apache NetBeans 12.6

Operating System

Windows 10

JDK

JDK 11

Apache NetBeans packaging

Apache NetBeans binary zip

Anything else

No response

Are you willing to submit a pull request?

No

Code of Conduct

Yes

s1mpleluluvn avatar Jun 21 '22 11:06 s1mpleluluvn

Out of interest, does running on JDK 18 correct this?

neilcsmith-net avatar Jun 21 '22 13:06 neilcsmith-net

Out of interest, does running on JDK 18 correct this?

it still wont work on JDK 18.

s1mpleluluvn avatar Jun 22 '22 04:06 s1mpleluluvn

Are you using flat LAF? If so, change it to something else and see if problem persists. I have encoding problem with flat LAF

rasa-app avatar Jun 22 '22 14:06 rasa-app

I use flat LAF yes. But I change to anything else it wont work. I use netbeans 12.6 flat LAF and it work like a charm.

s1mpleluluvn avatar Jun 23 '22 02:06 s1mpleluluvn

@s1mpleluluvn

  1. Do you have your Netbeans set to UTF-8? When you look under Help -> About what Encoding does it report? There should be some string like Windows 10 20H2 running on x64; UTF-8; nl_NL (nb). The part before the locale is the encoding Netbeans uses.

  2. When you create a simple Maven project and let it print out the following:

    System.out.println(Charset.defaultCharset());
    System.out.println(System.getProperty("file.encoding"));
    System.out.println(System.getProperty("native.encoding"));
    System.out.println(System.getProperty("sun.jnu.encoding"));
    

What does it say/What is the output?

  1. When you copy the string with the question marks to another editor, do the signs show up correctly? (E.g. go into Netbeans, write something like Đây là phiên bản UniKey mới nhất.. Then get ??y l? phi?n b?n UniKey m?i nh?t. and copy this over to something like notepad.exe. Does Notepad also show ??y l? phi?n b?n UniKey m?i nh?t. or does it show Đây là phiên bản UniKey mới nhất. for the text copied from Netbeans?)

duoduobingbing avatar Jun 23 '22 16:06 duoduobingbing

@duoduobingbing

  1. Both netbeans 12.6 and 14 is "System: Windows 10 version 10.0 running on amd64; Cp1252; en_US (nb)". And netbeans 12.6 still working.
  2. Both netbeans is windows-1252 and Cp1252.
  3. When I copy from notepad to netbeans, it change to "????" and when i copy it back from netbeans to notepad. it still change to "????". I try add "-J-Dfile.encoding=UTF-8" to netbeans.conf and it change Cp1252 to UTF-8. And it still not work... I use maven to print all properties. And no different from two version. Maybe it something deeper only netbeans-author knows.

s1mpleluluvn avatar Jun 23 '22 18:06 s1mpleluluvn

@s1mpleluluvn It is probably not caused by an encoding issue related to JDK18. (Your ansers to 1 and 2 prove this). It is also not a font issue as proven by your answer number 3.

This is something a maintainer of this project has to look into deeper.

I am sorry that I cannot be more of a help in this case.


Maybe as a workaround: When you install Vietnamese via Windows itself (Win+i and then Time & Language -> Language then Add language) and switch to the Windows Vietnamese keyboard layout (via Win+Space) and use this instead of UniKey; do you experience different behavior in Netbeans when typing Vietnamese?

duoduobingbing avatar Jun 23 '22 19:06 duoduobingbing

@duoduobingbing thanks you a lots for your help. Weird thing happen. I use keyboard from windows 10 itself and it work. then i realise because this keyboard from windows 10 use clipboard. And when I use option "always use clipboard" in Unikey and it work too.

Now I use this option and I can coding from netbeans 14. thank for your help. But it wont fix the real problem with netbeans 14. So I hope somedays the author can fix this.!

One again. Thanks you.

s1mpleluluvn avatar Jun 23 '22 19:06 s1mpleluluvn

I have been facing the same problem with characters in portuguese

GasanSP avatar Jul 21 '22 22:07 GasanSP

Same problem, in Thai language. (Using Windows 11) The character show □□□□ instead. However, Ubuntu version works fine. Not sure why.

lattebbrook avatar Jan 28 '23 07:01 lattebbrook