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

ISO-2022 decoders incorrectly return (char)b for bytes with MSB

XMLWordPrintable

    • b03
    • generic
    • generic
    • Not verified

      An input byte like 0xf0 should be rejected via MALFORMED[1]
      for ISO-2022 style decoders.
      Instead, it is converted into the nonsense character \ufff0 by being cast to char.
      Passthru for invalid characters is an interesting violation of the ISO-2022 standard,
      but in this case it should be converted to \u00f0.

       $ for cs in ISO-2022-KR ISO-2022-CN ISO-2022-CN-GB ISO-2022-CN-CNS; do printf "%s %s\n" $cs `jver /net/cremina/export/sherman/ws/rc java Decode $cs f0`; done
      ISO-2022-KR \ufff0
      ISO-2022-CN \ufff0
      ISO-2022-CN-GB \ufff0
      ISO-2022-CN-CNS \ufff0

            sherman Xueming Shen
            martin Martin Buchholz
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: