git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] gitweb: use CGI with -utf8
@ 2012-02-01 22:50 Michał Kiedrowicz
  2012-02-02 20:01 ` Jakub Narebski
  0 siblings, 1 reply; 14+ messages in thread
From: Michał Kiedrowicz @ 2012-02-01 22:50 UTC (permalink / raw)
  To: git; +Cc: Michał Kiedrowicz

I noticed that gitweb tries a lot to properly process UTF-8 data, for
example it prints my name correctly in log and commit information, but
it echos junk in the search field. It looks like:

	Michał Kiedrowicz

I don't know CGI well and I never touched gitewb code, but I found this
on http://www.lemoda.net/cgi/perl-unicode/index.html:

	use CGI '-utf8';
	my $value = params ('input');

I tried it and that fixed my problem. I'm not sure about the
consequences, maybe someone more experienced in CGI might help?
---
 gitweb/gitweb.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index abb5a79..74d45b1 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -10,7 +10,7 @@
 use 5.008;
 use strict;
 use warnings;
-use CGI qw(:standard :escapeHTML -nosticky);
+use CGI qw(:standard :escapeHTML -nosticky -utf8);
 use CGI::Util qw(unescape);
 use CGI::Carp qw(fatalsToBrowser set_message);
 use Encode;
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2012-02-03 21:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-01 22:50 [RFC PATCH] gitweb: use CGI with -utf8 Michał Kiedrowicz
2012-02-02 20:01 ` Jakub Narebski
2012-02-02 20:08   ` [PATCH/RFC (version A)] gitweb: use CGI with -utf8 to process Unicode query parameters correctly Jakub Narebski
2012-02-02 20:11     ` Jakub Narebski
2012-02-02 20:43     ` Michał Kiedrowicz
2012-02-02 20:10   ` [PATCH/RFC (version B)] gitweb: Allow UTF-8 encoded CGI query parameters and path_info Jakub Narebski
2012-02-02 20:46     ` Michał Kiedrowicz
2012-02-02 21:07       ` Jakub Narebski
2012-02-02 22:57         ` Jakub Narebski
2012-02-03  7:39           ` Michal Kiedrowicz
2012-02-03 12:44             ` [PATCH/RFCv2 " Jakub Narebski
2012-02-03 17:45               ` Michał Kiedrowicz
2012-02-03 21:09               ` Junio C Hamano
2012-02-02 20:38   ` [RFC PATCH] gitweb: use CGI with -utf8 Michał Kiedrowicz

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 NNTP newsgroup(s).