This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-01-02
Channels
- # beginners (29)
- # boot (65)
- # cider (12)
- # cljs-dev (8)
- # cljsjs (31)
- # clojars (5)
- # clojure (147)
- # clojure-austin (47)
- # clojure-berlin (1)
- # clojure-brasil (7)
- # clojure-russia (5)
- # clojure-spec (18)
- # clojure-uk (18)
- # clojurescript (113)
- # css (2)
- # cursive (7)
- # datascript (5)
- # datomic (2)
- # dirac (4)
- # events (3)
- # funcool (143)
- # hoplon (287)
- # jobs (2)
- # off-topic (4)
- # om (10)
- # om-next (5)
- # onyx (18)
- # protorepl (1)
- # re-frame (93)
- # reagent (34)
- # rum (41)
- # test-check (51)
- # untangled (15)
- # yada (18)
It returns a new Byte[]
on each call.
If you look at the actual byte values, they’ll be the same.
(seq (.getBytes "テhi" “UTF-8”))
;;=> (-29 -125 -122 104 105)
(seq (.getBytes "テhi" “UTF-8”))
;;=> (-29 -125 -122 104 105)
So that’s the underlying Java method on String returning a new byte array each time.Aha, thank you @seancorfield
alright, good news. it wasn’t actually an encoding issue, I had just written the code as though byte offsets/lengths are the same as string offsets/lengths. Fixed now.