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

InputStreamReader misses some characters while reading from FileInputStream with some IBM encodings

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • 5.0
    • 5.0u8
    • core-libs
    • None

      For following IBM encodings: x-IBM33722 and x-IBM964 that are listed in jdk1.5 documentation as supported encodings InputStreamReader misses every third character while reading them from FileInputStream char by char. I attached source of java application that demonstrates this problem and here's output from this application:


      JIS_X0212-1990 failed. Pattern: '0123456789', line read char by char by InputStreamReader: '?????', line read by BufferedReader: '?????'

      x-IBM33722 failed. Pattern: '0123456789', line read char by char by InputStreamReader: '0134679', line read by BufferedReader: '0123456789'

      x-IBM834 failed. Pattern: '0123456789', line read char by char by InputStreamReader: '??????????', line read by BufferedReader: '??????????'

      x-IBM964 failed. Pattern: '0123456789', line read char by char by InputStreamReader: '0134679', line read by BufferedReader: '0123456789'

      x-JIS0208 failed. Pattern: '0123456789', line read char by char by InputStreamReader: '?????', line read by BufferedReader: '?????'

      x-MacDingbat failed. Pattern: '0123456789', line read char by char by InputStreamReader: '??????????', line read by BufferedReader: '??????????'

      Here are two supported encodings - x-IBM33722 and x-IBM964 for which BufferedReader and InputStreamReader read different lines:

      "..line read char by char by InputStreamReader: '0134679', line read by BufferedReader: '0123456789'"

      This problem reproducible on jdk1.5 (build 1.5.0_08-b03). In jdk1.6 (build 1.6.0-beta2-b86) it was fixed.

            sherman Xueming Shen
            mismirno Mikhail Smirnov (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: