Netbeans on Windows and UTF-8 source code

Discussion in 'Java' started by yzzzzz, Jan 15, 2005.

  1. yzzzzz

    yzzzzz Guest

    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.
    yzzzzz, Jan 15, 2005
    #1
    1. Advertising

  2. yzzzzz

    Tilman Bohn Guest

    [xpost and f'up2 clj.softwaretools]

    In message <41e97654$0$6937$>,
    yzzzzz wrote on Sat, 15 Jan 2005 21:00:17 +0100:

    > 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.

    --
    Cheers, Tilman

    `Boy, life takes a long time to live...' -- Steven Wright
    Tilman Bohn, Feb 23, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pimousse
    Replies:
    2
    Views:
    3,616
    Roedy Green
    Apr 21, 2004
  2. Ilias Lazaridis
    Replies:
    0
    Views:
    894
    Ilias Lazaridis
    Dec 12, 2004
  3. Thomas G. Marshall
    Replies:
    2
    Views:
    814
    Thomas G. Marshall
    Oct 16, 2006
  4. jmfauth
    Replies:
    4
    Views:
    305
    jmfauth
    Oct 13, 2010
  5. Grzegorz ¦liwiñski
    Replies:
    2
    Views:
    934
    Grzegorz ¦liwiñski
    Jan 19, 2011
Loading...

Share This Page