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

SimpleDateFormat.parse returns null pointer for Japanese text

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P4 P4
    • None
    • 2.0_build23, 1.1.6
    • core-libs
    • sparc
    • solaris_2.5.1, solaris_2.6

      Using the parse method of SimpleDateFormat with Japanese text retuns a null pointer. English works fine. Test case below using the unicode from Japanese text: import java.text.*;
      import java.util.*;

      class ParseBug {
          public static void main(String[] args) {
              Date date = new Date();

              SimpleDateFormat fmt = new SimpleDateFormat("MMM d yyyy");
              Date d = fmt.parse("1 \267\356 1 1998", new ParsePosition(0));
              System.out.println("d = " + d.toString());
          }
      }

            okutsu Masayoshi Okutsu
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: