netbeans
netbeans copied to clipboard
Can not write utf-8 on Netbeans 14
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
Out of interest, does running on JDK 18 correct this?
Out of interest, does running on JDK 18 correct this?
it still wont work on JDK 18.
Are you using flat LAF? If so, change it to something else and see if problem persists. I have encoding problem with flat LAF
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
-
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. -
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?
- 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 likenotepad.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
- 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.
- Both netbeans is windows-1252 and Cp1252.
- 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 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 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.
I have been facing the same problem with characters in portuguese
Same problem, in Thai language. (Using Windows 11) The character show □□□□ instead. However, Ubuntu version works fine. Not sure why.