Trouble converting string/character to byte in lisp

Posted by WanderingPhd on Stack Overflow See other posts from Stack Overflow or by WanderingPhd
Published on 2012-10-05T21:35:54Z Indexed on 2012/10/05 21:36 UTC
Read the original article Hit count: 146

Filed under:
|

I've some data that I'm reading in using read-line and I want to convert it into a byte-array. babel:string-to-octet works for the most part except when the character\byte is larger (above 200) in which case it returns two numbers. As an example, if the character is ú using babel:string-to-octet returns (195 185) instead of 250 which is what I'm looking for. I tried a number of encodings in babel but none of them seem to work.

If I use read-byte or read-sequence it does read in 250. But for reasons of backward compatibility, I'm left with using read-line and I would like to know if there is something I'm missing when using babel:string-to-octet to convert ú to 250.

I'm using ccl 1.8 btw.

© Stack Overflow or respective owner

Related posts about lisp

Related posts about babel