cl-babel / babel

Babel is a charset encoding/decoding library, not unlike GNU libiconv, written in pure Common Lisp.
http://common-lisp.net/project/babel
Other
91 stars 27 forks source link

GBK broken? #31

Open eugeneia opened 7 years ago

eugeneia commented 7 years ago

I have the following test case that shows the GBK encoding to be broken:

echo "高怡雯" | iconv -t gbk -o /tmp/gao
# in Clozure CL
(let ((v (make-array 6 :element-type '(unsigned-byte 8))))
           (with-open-file (in "/tmp/gao"
                               :element-type '(unsigned-byte 8))
             (read-sequence v in)
             v))
→ #(184 223 226 249 246 169)
(babel:octets-to-string * :encoding :gbk)
→ "高恂霎"
luismbo commented 7 years ago

@levin108 can you take a look?