We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 4e542a5 + 4255382 commit 9ed0847Copy full SHA for 9ed0847
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,14 @@
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 text-bytes String) "utf-8")))
140
141
+ (.getBytes (convert (ByteArrayInputStream. text-bytes) String) "utf-8")))
142
143
+ (.getBytes (convert (ByteArrayInputStream. text-bytes) String {:chunk-size 100}) "utf-8")))))
0 commit comments