All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH/RFC] Gitweb: Convert UTF-8 encoded file names
@ 2014-05-14 18:41 Michael Wagner
  2014-05-14 21:57 ` Junio C Hamano
  0 siblings, 1 reply; 35+ messages in thread
From: Michael Wagner @ 2014-05-14 18:41 UTC (permalink / raw)
  To: git

[-- Attachment #1: 28222-Gitweb-Convert-UTF-8-encoded-file-names.patch --]
[-- Type: text/plain, Size: 876 bytes --]

Perl has an internal encoding used to store text strings. Currently, trying to
view files with UTF-8 encoded names results in an error (either "404 - Cannot
find file" [blob_plain] or "XML Parsing Error" [blob]). Converting these UTF-8
encoded file names into Perl's internal format resolves these errors.

Signed-off-by: Michael Wagner <accounts@mwagner.org>
---
 gitweb/gitweb.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index a9f57d6..6046977 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1056,7 +1056,7 @@ sub evaluate_and_validate_params {
 		}
 	}
 
-	our $file_name = $input_params{'file_name'};
+	our $file_name = decode("utf-8", $input_params{'file_name'});
 	if (defined $file_name) {
 		if (!is_valid_pathname($file_name)) {
 			die_error(400, "Invalid file parameter");
-- 
1.9.0

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

end of thread, other threads:[~2015-03-26 16:18 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-14 18:41 [PATCH/RFC] Gitweb: Convert UTF-8 encoded file names Michael Wagner
2014-05-14 21:57 ` Junio C Hamano
2014-05-14 22:25   ` Jakub Narębski
2014-05-15  5:08     ` Michael Wagner
2014-05-15  9:04       ` Peter Krefting
2014-05-15 17:24         ` Junio C Hamano
2014-05-15 18:48         ` Michael Wagner
2014-05-15 19:28           ` Jakub Narębski
2014-05-15 19:37             ` Jakub Narębski
2014-05-15 19:38             ` Junio C Hamano
2014-05-15 20:45               ` Jakub Narębski
2014-05-16  1:26                 ` Junio C Hamano
2014-05-16  7:54                   ` Jakub Narębski
2014-05-16 17:05                     ` Junio C Hamano
2014-05-27 14:18                       ` Jakub Narębski
2014-05-16 18:17                     ` Junio C Hamano
2014-05-27 14:22             ` [PATCH] gitweb: Harden UTF-8 handling in generated links Jakub Narębski
2014-06-04 15:41               ` Michael Wagner
2014-06-04 18:47                 ` Jakub Narębski
2014-06-04 20:47                   ` Michael Wagner
2015-03-23 21:35                   ` What's cooking in git.git (Mar 2015, #08; Mon, 23) Junio C Hamano
2014-12-17 14:18                     ` [PATCH v4] remote: add --fetch and --both options to set-url Peter Wu
2014-12-17 14:32                       ` Jeff King
2014-12-17 14:42                         ` Peter Wu
2014-12-17 22:31                       ` Junio C Hamano
2015-03-24 22:21                       ` What's cooking in git.git (Mar 2015, #08; Mon, 23) Junio C Hamano
2015-03-26 16:18                         ` Jeff King
2015-03-24 20:02                     ` Junio C Hamano
2015-03-24 20:04                       ` Jeff King
2015-03-24 20:08                     ` Junio C Hamano
2015-03-24 23:37                     ` Junio C Hamano
2015-03-24 22:26                   ` Junio C Hamano
2015-03-25  0:37                     ` Jakub Narębski
2015-03-25  1:05                       ` Junio C Hamano
2014-05-15 12:32       ` [PATCH/RFC] Gitweb: Convert UTF-8 encoded file names Jakub Narębski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.