trejder
trejder

Reputation: 17495

Force Netbeans to use UTF8 on files outside project

Is there any way to tell Netbeans 7.4, that it should use UTF-8 encoding, no matter what? Also for files outside any project and also for files, where character coding can't be determined?

Netbeans 7.4 (and earlier) always uses UTF-8 for all files in any project and always not uses it (uses ANSI or something else), when opening / saving file from outside any project. Since entire world goes toward UTF-8, I find this as a huge bug, though dev team claims, that this is design element.

No matter, how you call this, this is an unbelievable nightmare for me. When I want to use Netbeans to quickly edit some project-less PHP file, I always end up with messed national characters. Even if I save file in (ANSI?) Netbeans, open it in Notepad++, convert to UTF-8 and then reopen in Netbeans, it again forces some strange encoding on this file (ANSI?) and all national characters are messed. I tried converting file (in Notepad++) to both UTF-8 and UTF-8 without BOM. No effect.

Upvotes: 3

Views: 802

Answers (1)

midlan
midlan

Reputation: 154

I had same problem. Finally I found solution:

  1. locate and edit your netbeans.conf file, for me it was located here:

C:\Program Files\NetBeans 8.0.2\etc\netbeans.conf

  1. find netbeans_default_options line and add this new option to end:

-J-Dfile.encoding=UTF8

Upvotes: 1

Related Questions