Netbeans on Windows and UTF-8 source code

Y

yzzzzz

Hi,

My source code is in UTF-8. I am using Netbeans and my project won't
compile because the compiler thinks the source code is in ISO-8859-1.

Where can I change the encoding? I have *already* changed it in the
Netbeans options (so it displays right). I have also tried adding
<property name="javac.compilerargs" value="-encoding UTF-8"/> in
build-impl.xml (ant XML file) but it still doesn't compile.

Thank you for your help.

PS.
The error is e.g. on a line where I have
char c = 'é';
The compiler thinks it is
char c = 'é';
but obviously a character can't be 2 characters.
 
T

Tilman Bohn

[xpost and f'up2 clj.softwaretools]

Hi,

My source code is in UTF-8. I am using Netbeans and my project won't
compile because the compiler thinks the source code is in ISO-8859-1.

Where can I change the encoding? I have *already* changed it in the
Netbeans options (so it displays right).
[...]

I don't use netbeans, but firing it up real quick I see this in the
help text for the Building -> Compiler Types -> Internal Compiler ->
Encoding setting:

- Encoding. Sets the encoding that determines how the compiler
interprets characters beyond the ASCII character set. When you
compile a file, the IDE looks for encoding settings in the following
order:

1. In the settings for the compiler type associated with the
file
2. In the individual file's Encoding property
3. In the Default Encoding property for Java Sources settings
4. The system's default encoding

This leads me to suspect you may have set the encoding in the Java
Sources properties (Expert tab), but either 1. or 2. overrides that
setting. Try setting it there and see if that helps. Otherwise, someone
with more netbeans expertise than me will have to help you out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

UTF-8 problems with windows 31
Compilation of old source code. 0
netbeans 3
Unicode (UTF-8) in C 13
UTF-8 and strings 44
Encoding of surrogate code points to UTF-8 14
UTF-8 read & print? 6
MeCab UTF-8 Decoding Problem 6

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top