Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

netbeans 8.0.2 - can not print utf-8 characters correctly

As title says, I'm using Netbeans 8.0.2, on Windows 7 OS. I saw many different topics about this and tried different solutions, but none really helped.

So characters like [š, ć, đ, ž, È, æ] are displayed as � or squared, depending on the font. Here is what I've tried:

  • I have set -J-Dfile.encoding=UTF-8 in ../etc/netbeans.conf
  • I've checked project settings and encoding is set to utf-8

enter image description here

  • When I'm reading file, I'm using following code:

    BufferedReader(new InputStreamReader(new FileInputStream(file), "UTF-8")); or with Charset.forName("UTF-8") or StandardCharsets.UTF_8 or Charset.forName("ISO8859-2") nothing helped.

Any one has idea what other problem could be ?

like image 278
Kapparino Avatar asked Aug 04 '15 16:08

Kapparino


2 Answers

I have found out that this characters [š, ć, đ, ž, È, æ] are type Eastern European (Windows-1250).

So the correct encoding type is "Windows-1250".

like image 90
Kapparino Avatar answered Oct 06 '22 00:10

Kapparino


That's not a Netbeans issue per se, The netbeans FileAPI can open files in any encoding. When you don't know what encoding to use you can use this plugin to change the encoding dinamically.

Update: you can find the plugin now in the official plugins page as Encodding Support

like image 22
Ruslan López Avatar answered Oct 05 '22 23:10

Ruslan López