我评估以下代码
(org.httpkit.client/get "http://localhost:81"
#(clojure.pprint/pprint (.getBytes (:body %))))
它打印
[-17, -65, -67, -17, -65, -67]
如果 index.html 在 CP1251 中,并且
[-48, -80, -48, -79, -48, -78]
如果相同的文档是 UTF-8。
俄语中的 index.html 内容是
абв
http-kit 将响应正文作为 UTF-8 编码的字符串对象返回,但它不考虑 HTML 文档的实际字符集。这会导致身体像垃圾一样
"<html>�����</html>"
如何使 org.httpkit.client/get 看成文件的字符集?