Commons Codec
  1. Commons Codec
  2. CODEC-5

[codec] Hex converts illegal characters to 255

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2
    • Fix Version/s: 1.3
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      List: jakarta-commons-dev
      Subject: [codec] Proposal for improvement Hex codec
      From: Tom van den Berge <tom.vandenberge () bibit ! com>
      Date: 2004-04-15 8:49:31
      Message-ID: <407E4C9B.5070701 () bibit ! com>
      [Download message RAW]

      I'm using the Hex codec to decode e.g. the string "qq". What surprises
      me is that this obviously illegal hex value is decoded into one byte
      value 255. In fact all non-hex 'character-pairs' are decoded to value 255.

      Wouldn't it be better to throw a DecoderException if illegal characters
      are passed in?

      The current implementation decodes values that is is actually not able
      to decode, which is wrong.

      Cheers,
      Tom

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Gary Gregory
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development