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

Zenkaku characters don't line up correctly in javac diagnostics

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P5
    • Resolution: Won't Fix
    • Affects Version/s: 6
    • Fix Version/s: None
    • Component/s: tools
    • Subcomponent:
    • Introduced In Build:
      b27
    • Introduced In Version:
      6
    • CPU:
      generic
    • OS:
      generic

      Description

      I have simulated fat-ascii characters below with spaces.
      So the ascii string " k a n j i" should be interpreted
      as the equivalent in fat-ascii.

      The problem is that caret doesn't line up under the
      dot in line 8.

      In order to see the problem you must be using a terminal capable
      of displaying fat-ascii characters. For that purpose I used
      gnome-terminal in a utf-8 locale on Fedora Core 2 (Linux).

      $ cat -n MakeZenkaku.java
           1 import java.io.*;
           2
           3 public class MakeZenkaku {
           4 public static void main(String... args)
           5 throws FileNotFoundException,
           6 UnsupportedEncodingException
           7 {
           8 PrintWriter writer = new PrintWriter(args[0], args[1]);
           9 writer.println("public class Zenkaku {");
          10 writer.println(" @Deprecated");
          11 writer.println(" public static void \uff4b\uff41\uff4e\uff4a\uff49() {");
          12 writer.println(" System.out.println(\"\uff4b\uff41\uff4e\uff4a\uff49\");");
          13 writer.println(" }");
          14 writer.println(" public static void main(String... args) {");
          15 writer.println(" \uff4b\uff41\uff4e\uff4a\uff49();");
          16 writer.println(" \uff4b\uff41\uff4e\uff4a\uff49.\uff4b\uff41\uff4e\uff4a\uff49();");
          17 writer.println(" }");
          18 writer.println("}");
          19 writer.println("class \uff4b\uff41\uff4e\uff4a\uff49 {");
          20 writer.println(" @Deprecated");
          21 writer.println(" public static void \uff4b\uff41\uff4e\uff4a\uff49() {");
          22 writer.println(" System.out.println(\"\uff4b\uff41\uff4e\uff4a\uff49\");");
          23 writer.println(" }");
          24 writer.println(" public static void foo() {");
          25 writer.println(" Zenkaku.\uff4b\uff41\uff4e\uff4a\uff49();");
          26 writer.println(" }");
          27 writer.println("}");
          28 writer.flush();
          29 }
          30 }
      $ javac MakeZenkaku.java
      $ java MakeZenkaku Zenkaku.java utf-8
      $ LC_CTYPE=en_US.UTF-8 javac -Xlint:deprecation -encoding utf-8 Zenkaku.java
      Zenkaku.java:8: warning: [deprecation] k a n j i() in k a n j i has been deprecated
               k a n j i. k a n j i();
                   ^
      Zenkaku.java:17: warning: [deprecation] k a n j i() in Zenkaku has been deprecated
              Zenkaku. k a n j i();
                     ^
      2 warnings

      ###@###.### 2005-2-19 04:29:48 GMT

        Attachments

          Activity

            People

            Assignee:
            ahe Peter Ahe
            Reporter:
            ahe Peter Ahe
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: