We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7db6dc5 commit a19c96eCopy full SHA for a19c96e
test/byte_streams_test.clj
@@ -10,6 +10,7 @@
10
[java.nio.charset
11
Charset]
12
[java.io
13
+ ByteArrayInputStream
14
File]
15
[java.nio
16
ByteBuffer]
@@ -129,3 +130,12 @@
129
130
to-input-stream
131
(convert (seq-of ByteBuffer) {:chunk-size 1})
132
to-byte-array)))))
133
+
134
+(deftest test-unicode-decoding
135
+ (let [three-byte-char "丁"
136
+ text (apply str (repeat 10000 three-byte-char))
137
+ text-bytes (.getBytes text "utf-8")]
138
+ (is (bytes= text-bytes
139
+ (.getBytes (convert (ByteArrayInputStream. text-bytes) String) "utf-8")))
140
141
+ (.getBytes (convert (ByteArrayInputStream. text-bytes) String {:chunk-size 100}) "utf-8")))))
0 commit comments