[babel-devel] octets-to-string with UTF8 and Byte Order Marker

Luís Oliveira luismbo at gmail.com
Wed Apr 6 11:45:35 UTC 2011


Hello,

On Wed, Apr 6, 2011 at 11:07 AM, Rob Blackwell <rob.blackwell at aws.net> wrote:
> If I use (babel:octets-to-string foo) on a byte array with BOM markers, then
> my SBCL Lisp image dies.
>
> Is there a better way to ask Babel to discover the correct encoding by
> looking for Byte Order Marks? Ideally I’d like one function call that worked
> with any array and figured out which encoding was being used automatically
> and works whether or not a BOM is present?

Babel handles BOMs in UTF-16 and UTF-32 properly. It uses them to
identify endianness then skips them. I'm not sure what one's supposed
to do with BOMs in UTF-8; probably skip them, certainly not crash!
This will require some debugging.

Cheers,

-- 
Luís Oliveira
http://r42.eu/~luis/




More information about the babel-devel mailing list