[Haskell-cafe] Re: src/Text/XML/HaXml/Lex.hs:(156, 0)-(160, 22): Non-exhaustive patterns in function white

Gracjan Polak gracjanpolak at gmail.com
Fri Jul 23 04:46:49 EDT 2010

Alexander Kotelnikov <sacha <at> myxomop.com> writes:

> >>>>> On Wed, 21 Jul 2010 06:46:26 +0000 (UTC)
> >>>>> "GP" == Gracjan Polak <gracjanpolak <at> gmail.com> wrote:
> GP> 
> GP> Antoine Latter <aslatter <at> gmail.com> writes:
> >> Sending off to the maintainer of haxr, although it looks like it might
> >> be in HaXml (from an outside guess).
> GP> 
> GP> Without some real example to look at it will be quite tough to proceed.
> GP> 
> GP> Alexander, can you send that stream of packets to me?
> I attach a stream dump.
> Attachment (poster.dump): application/octet-stream, 2916 bytes

My guess at this point:

Your XML contains PNG as binary data. Since this part is interpreted as a string
with UTF-8 encoding we have big trouble here. Some of byte combinations in PNG
do not constitute correct coding points, are probably converted/normalized and
are interpreted as invalid XML.

Solution: use text-based encoding for binary data. Base64 seems to be obvius
candidate here.


More information about the Haskell-Cafe mailing list