about summary refs log tree commit homepage
path: root/lib/PublicInbox/ContentId.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/ContentId.pm')
-rw-r--r--lib/PublicInbox/ContentId.pm9
1 files changed, 1 insertions, 8 deletions
diff --git a/lib/PublicInbox/ContentId.pm b/lib/PublicInbox/ContentId.pm
index b1d27eb8..dd3155be 100644
--- a/lib/PublicInbox/ContentId.pm
+++ b/lib/PublicInbox/ContentId.pm
@@ -75,14 +75,7 @@ sub content_digest ($) {
                 }
                 $dig->add("b\0");
                 my $ct = $part->content_type || 'text/plain';
-                my $s = eval { $part->body_str };
-                if ($@ && $ct =~ m!\btext/plain\b!i) {
-                        # Try to assume UTF-8 because Alpine
-                        # seems to do wacky things and set
-                        # charset=X-UNKNOWN
-                        $part->charset_set('UTF-8');
-                        $s = eval { $part->body_str };
-                }
+                my ($s, undef) = msg_part_text($part, $ct);
                 if (defined $s) {
                         $s =~ s/\r\n/\n/gs;
                         $s =~ s/\s*\z//s;