clojure.data.codec

UTF-8 characters decoding error

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code

Description

When function decode! use the clojure.core.byte function to aset byte-array a value more than 127, it generate an exception like below.

"java.lang.IllegalArgumentException: Value out of range for byte: 128
RT.java:1019 clojure.lang.RT.byteCast"

You can try this by executing "(byte 128)" in repl.

This is because java doesn't hava any unsinged primitive type.
The byte type value range from -128 to 127, not from 0 to 255.

I patch a code to solve this (git diff)

Activity

Hide
Park Sang Kyu added a comment -

I have signed CA.

Show
Park Sang Kyu added a comment - I have signed CA.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: