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

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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Duplicate
    • Affects Version/s: 5.0u8
    • Fix Version/s: 5.0
    • Component/s: core-libs
    • Labels:
      None

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: