[CLJ-1393] clojure.string/trim doesn't trim null character Created: 28/Mar/14 Updated: 28/Mar/14 Resolved: 28/Mar/14
|Affects Version/s:||Release 1.6|
I noticed this because base64 uses null characters to pad the end of encoding blocks.
Clojure 1.6.0's trim leaves the null character in:
java.lang.String's trim takes it out:
Here are the first 21 unicode characters and what Character/isWhitespace says about them.
(dotimes [n 0x20] (printf "
|Comment by Alex Miller [ 28/Mar/14 12:27 PM ]|
The choice was made in
|Comment by Ryan Fowler [ 28/Mar/14 1:03 PM ]|
Indeed, it's an easy workaround to use Java interop once you figure out what your problem is.
It's just unintuitive that the character generally used for string termination isn't trimmed by clojure.string/trim.