Can compiled java with simplified chinese embedded?

Discussion in 'Java' started by Wandy Tang, Jul 20, 2004.

  1. Wandy Tang

    Wandy Tang Guest

    Dear All,

    I am making a servlet that will display simplified chinese character, the
    character seems normal during open with notepad but when compling, it has
    error message says

    "gb.java:1: illegal character: \65279"
    import java.io.*; // it should says import java.io.*

    I use "javac.exe -encoding UTF-8 gb.java" command for compling.

    The servlet has saved as a UTF-8 format file.

    Regards
    Wandy
     
    Wandy Tang, Jul 20, 2004
    #1
    1. Advertising

  2. Wandy Tang wrote:
    > I am making a servlet that will display simplified chinese character, the
    > character seems normal during open with notepad but when compling, it has
    > error message says
    >
    > "gb.java:1: illegal character: \65279"
    > import java.io.*; // it should says import java.io.*
    >
    > I use "javac.exe -encoding UTF-8 gb.java" command for compling.
    >


    BOM mark, remove it. See a similar discussion from a few days ago:

    http://groups.google.com/groups?threadm=40edabe3$

    /Thomas
     
    Thomas Weidenfeller, Jul 20, 2004
    #2
    1. Advertising

  3. Wandy Tang wrote:
    > I am making a servlet that will display simplified chinese character, the
    > character seems normal during open with notepad but when compling, it has
    > error message says
    >
    > "gb.java:1: illegal character: \65279"
    > import java.io.*; // it should says import java.io.*
    >
    > I use "javac.exe -encoding UTF-8 gb.java" command for compling.
    >
    > The servlet has saved as a UTF-8 format file.


    Character 65279 (FEFF in hex) is a byte order mark, apparently inserted
    by your editor. For UTF-8, this serves no purpose, and it seems the Java
    compiler disallows it completely (as byte order marks are generally not
    used in Java).

    Look through the configuration options of your editor to see whether it
    can be made not to write the byte order mark, otherwise look for a different
    editor.
     
    Michael Borgwardt, Jul 20, 2004
    #3
  4. Wandy Tang

    Sam Guest

    "Wandy Tang" <> wrote in message news:<cdjakm$>...
    > Dear All,
    >
    > I am making a servlet that will display simplified chinese character, the
    > character seems normal during open with notepad but when compling, it has
    > error message says
    >
    > "gb.java:1: illegal character: \65279"
    > import java.io.*; // it should says import java.io.*
    >
    > I use "javac.exe -encoding UTF-8 gb.java" command for compling.
    >
    > The servlet has saved as a UTF-8 format file.
    >
    > Regards
    > Wandy



    Wandy,

    I don't know the answer to your question, but I have one of my own.
    Why do you need to store the source code as UTF-8? You can use
    encoding/decoding on input/ output as required. I've played around
    with displaying Japanese in Java and have never had to worry about the
    source code encoding.

    Regards,
    Sam90
     
    Sam, Jul 20, 2004
    #4
  5. Wandy Tang

    Roedy Green Guest

    On Tue, 20 Jul 2004 22:36:05 +0800, "Wandy Tang"
    <> wrote or quoted :

    >"gb.java:1: illegal character: \65279"
    >import java.io.*; // it should says import java.io.*
    >
    >I use "javac.exe -encoding UTF-8 gb.java" command for compling.
    >
    >The servlet has saved as a UTF-8 format file.


    see http://mindprod.com/jgloss/bom.html

    --
    Canadian Mind Products, Roedy Green.
    Coaching, problem solving, economical contract programming.
    See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
     
    Roedy Green, Jul 20, 2004
    #5
    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. Grey

    simplified chinese encoding

    Grey, Apr 20, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    516
  2. rfractal30
    Replies:
    5
    Views:
    529
    rfractal30
    Feb 21, 2005
  3. den 2005
    Replies:
    0
    Views:
    197
    den 2005
    Oct 18, 2006
  4. David A. Caballero J.

    Problem with simplified chinese

    David A. Caballero J., Jul 7, 2004, in forum: ASP General
    Replies:
    1
    Views:
    182
    Captain Flack
    Jul 8, 2004
  5. Paulo

    Simplified Chinese

    Paulo, Aug 10, 2009, in forum: ASP General
    Replies:
    4
    Views:
    771
    Tang Heng
    Aug 26, 2009
Loading...

Share This Page