From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yasushi SHOJI Subject: [PATCH] gitweb: convert from perl internal to utf8 for commitdiff_plain Date: Tue, 29 Jan 2008 11:14:00 +0900 Message-ID: <87ve5dicih.wl@mail2.atmark-techno.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Jan 29 04:05:54 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 1JJgmd-0004MM-7K for gcvg-git-2@gmane.org; Tue, 29 Jan 2008 04:05:36 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754869AbYA2DEJ (ORCPT ); Mon, 28 Jan 2008 22:04:09 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754825AbYA2DEJ (ORCPT ); Mon, 28 Jan 2008 22:04:09 -0500 Received: from mail2.atmark-techno.com ([210.191.215.173]:39901 "EHLO mail2.atmark-techno.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754805AbYA2DEH (ORCPT ); Mon, 28 Jan 2008 22:04:07 -0500 X-Greylist: delayed 1662 seconds by postgrey-1.27 at vger.kernel.org; Mon, 28 Jan 2008 22:04:07 EST 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 9827F584B9; Tue, 29 Jan 2008 11:36:22 +0900 (JST) 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: commitdiff with raw, or plain format if you are reading the code, doesn't convert any word from perl internal to utf8, which is set to charset in http header. this cause a problem when commit includes non ascii code. here is a few example in the git tree: http://git.kernel.org/?p=git/git.git;a=commitdiff_plain;h=6ba78238a824282816944550edc4297dd2808a72 http://git.kernel.org/?p=git/git.git;a=commitdiff_plain;h=e360bebf713b6b03768c62de8b94ddf9350b0953 http://git.kernel.org/?p=git/git.git;a=commitdiff_plain;h=9459aa77a032621a29d53605542844641cca843a This patch effectively revert the commitdiff plain part of the commit 59b9f61a3f76762dc975e99cc05335a3b97ad1f9 which converted from print to here-doc. but it doesn't explain why in the commit log. --- gitweb/gitweb.perl | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 6256641..5d9ac1d 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -5048,16 +5048,16 @@ sub git_commitdiff { -expires => $expires, -content_disposition => 'inline; filename="' . "$filename" . '"'); my %ad = parse_date($co{'author_epoch'}, $co{'author_tz'}); - print <self_url() . "\n\n"; foreach my $line (@{$co{'comment'}}) { - print "$line\n"; + print to_utf8($line) . "\n"; } print "---\n\n"; } -- 1.5.4.rc5.1.g0d200