Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6366696

javac in JDK 1.5 produces compilation warning message for comment lines containing the "©" character

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 5.0
    • 5.0
    • tools
    • generic
    • generic

      Most of the Java Card source files contain a copyright line with the © character, which results in a compilation warning when using javac from JDK 1.5. These used to compile without warning using javac from JDK 1.4.x.

      The javac (ver. 1.5) warning message is: "unmappable character for encoding ASCII"

      Our only option is to use the javac -nowarn option, but that is unacceptable.

      Sun legal requires us to use the © character instead of (c).
      If you believe this is not the case, please send us a statement from Sun legal.

      But, consider that customers may also want to insert copyright statments which include the © character.

      ==================== file copyright.java

      // Copyright © 2003 Sun Microsystems, Inc.

      public class copyright {

        public static void main(String[] args){
          System.out.println("done");
        }

      }

      1) set JAVA_HOME to JDK1.4.x and compile:

      jcdi-qa-1 (26) % $JAVA_HOME/bin/java -version
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)
      jcdi-qa-1 (27) % $JAVA_HOME/bin/javac copyright.java

      (there is no compilation warning).


      2) set JAVA_HOME to JDK1.5.0 and compile:

      jcdi-qa-1 (29) % $JAVA_HOME/bin/java -version
      java version "1.5.0_01"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
      Java HotSpot(TM) Server VM (build 1.5.0_01-b08, mixed mode)


      jcdi-qa-1 (30) % $JAVA_HOME/bin/javac copyright.java
      copyright.java:1: warning: unmappable character for encoding ASCII
      // Copyright ? 2003 Sun Microsystems, Inc.
                   ^
      1 warning

      ===============================================================================

            Unassigned Unassigned
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: