From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yasushi SHOJI Subject: Re: [PATCH] gitweb: convert from perl internal to utf8 for commitdiff_plain Date: Tue, 29 Jan 2008 21:16:02 +0900 Message-ID: <87ejc0j08t.wl@mail2.atmark-techno.com> References: <87ve5dicih.wl@mail2.atmark-techno.com> <7vir1dqjg0.fsf@gitster.siamese.dyndns.org> <87fxwhi3qj.wl@mail2.atmark-techno.com> <7vejc1qium.fsf@gitster.siamese.dyndns.org> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: git@vger.kernel.org To: Junio C Hamano X-From: git-owner@vger.kernel.org Tue Jan 29 13:48:00 2008 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1JJpsd-00058W-JU for gcvg-git-2@gmane.org; Tue, 29 Jan 2008 13:48:00 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754878AbYA2Mr2 convert rfc822-to-quoted-printable (ORCPT ); Tue, 29 Jan 2008 07:47:28 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755013AbYA2Mr2 (ORCPT ); Tue, 29 Jan 2008 07:47:28 -0500 Received: from mail2.atmark-techno.com ([210.191.215.173]:41880 "EHLO mail2.atmark-techno.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754412AbYA2Mr1 convert rfc822-to-8bit (ORCPT ); Tue, 29 Jan 2008 07:47:27 -0500 Received: from wat.atmark-techno.com.atmark-techno.com (dns1.atmark-techno.com [210.191.215.170]) by mail2.atmark-techno.com (Postfix) with ESMTP id 4C88A584FB; Tue, 29 Jan 2008 21:16:02 +0900 (JST) Cc: Jakub Narebski Cc: Ismail =?ISO-8859-1?Q?D=F6nmez?= In-Reply-To: <7vejc1qium.fsf@gitster.siamese.dyndns.org> User-Agent: Wanderlust/2.14.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: At Mon, 28 Jan 2008 21:52:17 -0800, Junio C Hamano wrote: >=20 > Yasushi SHOJI writes: >=20 > > At Mon, 28 Jan 2008 21:39:27 -0800, > > Junio C Hamano wrote: > >>=20 > >> Yasushi SHOJI writes: > >>=20 > >> > This patch effectively revert the commitdiff plain part of the c= ommit > >> > > >> > 59b9f61a3f76762dc975e99cc05335a3b97ad1f9 > >> > > >> > which converted from print to here-doc. but it doesn't > >> > explain why in the commit log. > >>=20 > >> I think the patch makes sense but the above is misleading. Read > >> it again. > >>=20 > >> Doesn't it sound like you are accusing that 59b9f61a introduced > >> a regression when it converted existsing "print utf8()" to > >> "print < > > > sorry about my stupid english. What I meant was that because commi= t > > log doesn't say _why_ it changed to here-doc, I couldn't be sure it > > was ok to overwrite the change introduced by the commit 59b9f61a3. > > > > IOW, I was tring to ask, "is it ok to revert back to print?" >=20 > Sure. Can I forge your Sign-off? =46rom 127a6abaf23991394b3b2c5455c2522f9da1e8ac Mon Sep 17 00:00:00 200= 1 =46rom: Yasushi SHOJI Date: Tue, 29 Jan 2008 20:48:33 +0900 Subject: [PATCH] gitweb: Convert generated contents to utf8 in commitdi= ff_plain MIME-Version: 1.0 Content-Type: text/plain; charset=3Dutf-8 Content-Transfer-Encoding: 8bit If the commit message, or commit author contains non-ascii, it must be converted from Perl internal representation to utf-8, to follow what got declared in HTTP header. Use to_utf8() to do the conversion. This necessarily replaces here-doc with "print" statements. Signed-off-by: Yasushi SHOJI Acked-by: =C4=B0smail D=C3=B6nmez Acked-by: Jakub Narebski --- Jakub, thanks for much better commit log. I just copy & pasted to new commit. One thing I've changed from the last patch was, as Jakub and Ismail pointed out, the Date line. I've: - removed to_utf8(), and - made it one line I also noticed that I've removed parentheses from the line by accident, so I put them back. Junio, please use this if you are ok. Thanks, gitweb/gitweb.perl | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 6256641..80e3d0a 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -5048,16 +5048,15 @@ sub git_commitdiff { -expires =3D> $expires, -content_disposition =3D> 'inline; filename=3D"' . "$filename" . '"= '); my %ad =3D parse_date($co{'author_epoch'}, $co{'author_tz'}); - print <self_url() . "\n\n"; =20 foreach my $line (@{$co{'comment'}}) { - print "$line\n"; + print to_utf8($line) . "\n"; } print "---\n\n"; } --=20 1.5.4.rc5.1.g0d200