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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0
    • Component/s: tools
    • Labels:
    • Subcomponent:
    • CPU:
      generic
    • OS:
      generic

      Description

      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

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

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: