user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 1/3] view: attach_link uses string concatentation
  2016-08-18  1:39  6% [PATCH 0/3] attempt to display text/plain with bogus charsets Eric Wong
@ 2016-08-18  1:39  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2016-08-18  1:39 UTC (permalink / raw)
  To: meta; +Cc: Thomas Ferris Nicolaisen, Johannes Schindelin

There is no point in using an array to join on an
empty string (my original intention was probably to
join on "\n").

This is only preparation for the next change to show
a warning to in the attachment link.
---
 lib/PublicInbox/View.pm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 6f79f60..3057221 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -427,10 +427,10 @@ sub attach_link ($$$$) {
 	} else {
 		$sfn = 'a.bin';
 	}
-	my @ret = qq($nl<a\nhref="$upfx$idx-$sfn">[-- Attachment #$idx: );
+	my $ret = qq($nl<a\nhref="$upfx$idx-$sfn">[-- Attachment #$idx: );
 	my $ts = "Type: $ct, Size: $size bytes";
-	push(@ret, ($desc eq '') ? "$ts --]" : "$desc --]\n[-- $ts --]");
-	join('', @ret, "</a>\n");
+	$ret .= ($desc eq '') ? "$ts --]" : "$desc --]\n[-- $ts --]";
+	$ret .= "</a>\n";
 }
 
 sub add_text_body {
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/3] attempt to display text/plain with bogus charsets
@ 2016-08-18  1:39  6% Eric Wong
  2016-08-18  1:39  7% ` [PATCH 1/3] view: attach_link uses string concatentation Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2016-08-18  1:39 UTC (permalink / raw)
  To: meta; +Cc: Thomas Ferris Nicolaisen, Johannes Schindelin

Thomas Ferris Nicolaisen reported a problem with Dscho's
Git for Windows 2.9.3 announcement not rendering text inline:

https://public-inbox.org/git/alpine.DEB.2.20.1608131214070.4924@virtualbox/

This was caused by the bogus charset=X-UNKNOWN set by Alpine.
Attempt to handle it as UTF-8, but fall back to blindly showing
it to the user.  In either case, warn users about the mangled
text.


Eric Wong (3):
  view: attach_link uses string concatentation
  view: try to display bogus charsets for text/plain
  view: try assuming UTF-8 for bogus charsets

 lib/PublicInbox/View.pm | 40 +++++++++++++++++++++++++++++++---------
 1 file changed, 31 insertions(+), 9 deletions(-)

-- 
EW

^ permalink raw reply	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2016-08-18  1:39  6% [PATCH 0/3] attempt to display text/plain with bogus charsets Eric Wong
2016-08-18  1:39  7% ` [PATCH 1/3] view: attach_link uses string concatentation 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).