netbeans
netbeans copied to clipboard
Accented vowelds inside string show unknow character (?)
Apache NetBeans version
Apache NetBeans 23
What happened
When i try to write an spanish word with accent inside a double cuote or simple cuote, it show an unknow sign (?). Entire project is under UTF8. Spanish keyboard layout works successfully in the rest of Operating system and anothers text editors and terminal too.
Language / Project Type / NetBeans Component
PHP project
How to reproduce
Following assignment: $myVar = "Usted cometió un error"; it's viewed in netbeans editor as: $myVar = "Usted cometi� un error";
Did this work correctly in an earlier version?
No / Don't know
Operating System
Linux Mint 21
JDK
17
Apache NetBeans packaging
Apache NetBeans provided installer
Anything else
No response
Are you willing to submit a pull request?
No
What font is configured in Tools -> Options -> Fonts and Colors. I use Haskling, but the Ubuntu Terminal font is also a a good alternative.
i use "Source Code Pro Medium 14" and the example word you posted is rendered correctly for me. Some linux distributions have extra font packages for mono-spaced coding fonts.
tengo el mismo problema ..... en la pestaña run ,,,, no me aparecen los acentos .... mi sistema operativo es windows 11
@mbien , @matthiasblaesing with any Font configured the problem persist. I've donwloaded "Source Code Pro" too and the problem continue. I'm thinking the origin is another thing.
Product Version: Apache NetBeans IDE 23 Java: 17.0.12; OpenJDK 64-Bit Server VM 17.0.12+7-Ubuntu-1ubuntu222.04 Runtime: OpenJDK Runtime Environment 17.0.12+7-Ubuntu-1ubuntu222.04 System: Linux version 5.15.0-76-generic running on amd64; UTF-8; es_CU (nb)
what is your output for:
public static void main(String[] args) {
System.out.println(Runtime.version());
System.out.println();
System.out.println("Charset.defaultCharset(): " + Charset.defaultCharset());
System.out.println("file.encoding property:" + System.getProperty("file.encoding"));
System.out.println("native.encoding property:" + System.getProperty("native.encoding"));
System.out.println("sun.jnu.encoding property:" + System.getProperty("sun.jnu.encoding"));
System.out.println("stdout.encoding property:" + System.getProperty("stdout.encoding"));
System.out.println("sun.stdout.encoding property:" + System.getProperty("sun.stdout.encoding"));
}
what happens if you create a new text file with netbeans, then paste your sample String into the file?
what is your output for:
public static void main(String[] args) { System.out.println(Runtime.version()); System.out.println(); System.out.println("Charset.defaultCharset(): " + Charset.defaultCharset()); System.out.println("file.encoding property:" + System.getProperty("file.encoding")); System.out.println("native.encoding property:" + System.getProperty("native.encoding")); System.out.println("sun.jnu.encoding property:" + System.getProperty("sun.jnu.encoding")); System.out.println("stdout.encoding property:" + System.getProperty("stdout.encoding")); System.out.println("sun.stdout.encoding property:" + System.getProperty("sun.stdout.encoding")); }what happens if you create a new text file with netbeans, then paste your sample String into the file?
Out:
Runtime: 17.0.12+7-Ubuntu-1ubuntu222.04
Charset.defaultCharset(): UTF-8
file.encoding property:UTF-8
native.encoding property:UTF-8
sun.jnu.encoding property:UTF-8
stdout.encoding property:null
sun.stdout.encoding property:null
New files, same problem.
hmm. everything is UTF-8 (which is to be expected on linux), which is good and newly created files have the same problem too. Can't come up with a cause for this right now outside of font problems - but you mentioned you swapped the font already too.
You could try JDK 21 from a different vendor (e.g temurin, zulu, oracle or corretto builds) to exclude this as a potential cause. To test this you could extract a JDK somewhere (without installing) and pass it as --jdkhome <path> option to the netbeans launcher (or update it in the etc/netbeans.conf file).
@mbien Thank youu!!, with openjdk-21 the problem was solved!!!!
@frizquierdo this JDK is from the ubuntu repository too? I am asking since it sometimes happens that packages itself contain bugs. Thats why it can be useful to check the same version but from a different vendor.
But good to know that it is working for you now
@frizquierdo this JDK is from the ubuntu repository too? ...
Yes, it's from ubuntu (jammy) repository, openjdk-21-jdk package.