Subject: | PATCH: add option to allow bad encoding in decoded_content |
If a webserver returns badly encoded data (bad utf8), I still need to be
able to get it decoded. Please add an option to ignore problems, e.g
like with the attached patch.
IMHO, since that's the default in Encode, ignoring a bad encoding might
be the better default. Also, maybe a way for setting a global default
error mode in Encode would be the better solution. However, I don't
think that's for me to decide and I'd be happy if my patch makes it into
the distribution.
Thanks, Rolf.
Subject: | lwp.diff |
--- Message.pm.orig Tue Sep 20 20:32:16 2005
+++ Message.pm Mon Jan 30 20:47:13 2006
@@ -269,7 +269,7 @@
$content_ref_iscopy++;
}
$content_ref = \Encode::decode($charset, $$content_ref,
- Encode::FB_CROAK() | Encode::LEAVE_SRC());
+ $opt{ignore_encode_failure} ? Encode::FB_DEFAULT() : Encode::FB_CROAK() | Encode::LEAVE_SRC());
}
}
};