git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH/RFCv2 (version B)] gitweb: Allow UTF-8 encoded CGI query parameters and path_info

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 3, 2012, 21:09 UTC
Message-ID
<7vzkczmxon.fsf@alter.siamese.dyndns.org>
In-Reply-To
<201202031344.55750.jnareb@gmail.com>
Jakub Narebski <jnareb@gmail.com> writes:
Show 7 quoted lines
> Gitweb tries hard to properly process UTF-8 data, by marking output
> from git commands and contents of files as UTF-8 with to_utf8()
> subroutine.  This ensures that gitweb would print correctly UTF-8
> e.g. in 'log' and 'commit' views.
>
> Unfortunately it misses another source of potentially Unicode input,
> namely query parameters.  The result is that one cannot search for a
I think two lines should suffice instead of the above two paragraphs.
        Gitweb forgot to turn query parameters into UTF-8. This results in
        a bug that one cannot search for a
> string containing characters outside US-ASCII.  For example searching
> ...

The remainder explains the problem and the solution very well modulo minor typos.

> Noticed-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
> Signed-off-by: Jakub Narębski <jnareb@gmail.com>
> ---
We can add "Tested-by:" to this now.  Will queue.
Thanks.
Previous: Michał KiedrowiczNext: Michał Kiedrowicz
Message 13 of 14 in “gitweb: use CGI with -utf8”
  1. gitweb: use CGI with -utf8Michał Kiedrowicz, Feb 1, 2012
  2. Jakub NarebskiFeb 2, 2012
  3. gitweb: use CGI with -utf8 to process Unicode query parameters correctlyJakub Narebski, Feb 2, 2012
  4. Jakub NarebskiFeb 2, 2012
  5. Michał KiedrowiczFeb 2, 2012
  6. gitweb: Allow UTF-8 encoded CGI query parameters and path_infoJakub Narebski, Feb 2, 2012
  7. Michał KiedrowiczFeb 2, 2012
  8. Jakub NarebskiFeb 2, 2012
  9. Jakub NarebskiFeb 2, 2012
  10. Michal KiedrowiczFeb 3, 2012
  11. gitweb: Allow UTF-8 encoded CGI query parameters and path_infoJakub Narebski, Feb 3, 2012
  12. Michał KiedrowiczFeb 3, 2012
  13. Junio C HamanoFeb 3, 2012
  14. Michał KiedrowiczFeb 2, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.