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

JDK1.2 failed to display MultiCharsetString correctly on Win32

XMLWordPrintable

    • 1.2beta2
    • generic, sparc
    • solaris_2.5.1, windows_nt
    • Verified

      JDK1.2 failed to display MultiCharsetString correctly on Win32,
      The following sample shows the problem.
      (1)Substitute "JAPANESE" by a not 8859-1 string
      (2)Run sample under not-English version of Win32 envirenment.

      import java.awt.*;

      public class sample {
              public static void main( String[] args ) {
                      createa();
              }

              static void createa () {

                      Frame a=new Frame("Test");
      TestCanvas tc = new TestCanvas();

                      a.setLayout(new BorderLayout());
      tc.setSize(100, 100);
      //substitute JAPANESE to any no-ASCII string
      tc.setText("abcd" + "JAPANESE" + "efgh");
                      a.add("Center", tc);

      a.pack();
                      a.show();
              }
      }

      class TestCanvas extends Canvas {
              String s;
              public TestCanvas() {
                      super();
              }
              public void setText(String st) {
                      s = new String(st);
                      repaint();
              }
              public void paint(Graphics g) {
                      g.drawString(s, 0, 20);
              }
      }

            brenaudsunw Benjamin Renaud (Inactive)
            sherman Xueming Shen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: