* [PATCH 1/2] msgiter: attempt to decode all text/* bodies
2019-10-31 3:12 5% [PATCH 0/2] attached patches and false-positive dfpost: Eric Wong
@ 2019-10-31 3:12 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2019-10-31 3:12 UTC (permalink / raw)
To: meta
We want to index text/x-patch and text/x-diff, at least,
since "git format-patch" can generate a patch series as
attachments using --attach.
---
lib/PublicInbox/MsgIter.pm | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/lib/PublicInbox/MsgIter.pm b/lib/PublicInbox/MsgIter.pm
index f11ba223..d9df32ab 100644
--- a/lib/PublicInbox/MsgIter.pm
+++ b/lib/PublicInbox/MsgIter.pm
@@ -45,12 +45,18 @@ sub msg_part_text ($$) {
# times when it should not have been:
# <87llgalspt.fsf@free.fr>
# <200308111450.h7BEoOu20077@mail.osdl.org>
- if ($err && ($ct =~ m!\btext/plain\b!i ||
+ if ($err && ($ct =~ m!\btext/\b!i ||
$ct =~ m!\bmultipart/mixed\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 $cte = $part->header_raw('Content-Transfer-Encoding');
+ if (defined($cte) && $cte =~ /\b7bit\b/i) {
+ $s = $part->body;
+ $err = undef if $s =~ /\A[[:ascii:]]+\z/s;
+ } else {
+ # 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 };
+ }
# If forcing charset=UTF-8 failed,
# caller will warn further down...
^ permalink raw reply related [relevance 7%]
* [PATCH 0/2] attached patches and false-positive dfpost:
@ 2019-10-31 3:12 5% Eric Wong
2019-10-31 3:12 7% ` [PATCH 1/2] msgiter: attempt to decode all text/* bodies Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2019-10-31 3:12 UTC (permalink / raw)
To: meta
Once reindexed, all the patches attached at
https://public-inbox.org/git/b9fb52b8-8168-6bf0-9a72-1e6c44a281a5@oracle.com/
should be "solvable".
Eric Wong (2):
msgiter: attempt to decode all text/* bodies
solvergit: deal with false-positive dfpost: results
lib/PublicInbox/MsgIter.pm | 16 +++++++---
lib/PublicInbox/SolverGit.pm | 59 ++++++++++++++++++++++++++++--------
2 files changed, 57 insertions(+), 18 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-10-31 3:12 5% [PATCH 0/2] attached patches and false-positive dfpost: Eric Wong
2019-10-31 3:12 7% ` [PATCH 1/2] msgiter: attempt to decode all text/* bodies Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).