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

Re: [PATCH] gitweb: use decode_utf8 directly

From
IDIsmail Dönmez <ismail@pardus.org.tr>
Date
May 1, 2007, 21:48 UTC
Message-ID
<200705020048.53853.ismail@pardus.org.tr>
In-Reply-To
<200705020044.47171.ismail@pardus.org.tr>
On Wednesday 02 May 2007 00:44:46 you wrote:
Show 24 quoted lines
> On Wednesday 02 May 2007 00:39:34 you wrote:
> > Ismail Dönmez <ismail@pardus.org.tr> writes:
> > > Ok found out the reason. decode() tries to decode data that is already
> > > UTF-8 and borks.
> > >
> > > This is from Encode.pm :
> > >
> > > sub decode_utf8($;$) {
> > >     my ( $str, $check ) = @_;
> > >     return $str if is_utf8($str); <--- Checks if the $str is already
> > > UTF-8 if ($check) {
> > >         return decode( "utf8", $str, $check ); <--- Else do what gitweb
> > > does [...]
> > >
> > > So my patch is indeed correct.
> >
> > Ok, I think that makes it an improvement from the current code,
> > so I'd apply.
> >
> > But at the same time I wonder why should the callers be feeding
> > an already decoded string to to_utf8().  It might be that some
> > callers needs fixing.
>
> FWIW it was passing my name "İsmail Dönmez" based on user info I guess.
I guess its line 1116:
 if (check_export_ok("$projectroot/$path")) {
	my $pr = {
	path => $path,
	owner => to_utf8($owner), <---- Here
};

My system is configured for UTF-8 so $owner will be UTF-8 but in some systems it might not be so I don't think there is anything to fix here.

Regards, ismail

Previous: Ismail DönmezNext: Ismail Dönmez
Message 9 of 21 in “gitweb: use decode_utf8 directly”
  1. gitweb: use decode_utf8 directlyIsmail Dönmez, Apr 24, 2007
  2. Ismail DönmezApr 27, 2007
  3. Junio C HamanoApr 27, 2007
  4. Ismail DönmezApr 27, 2007
  5. Junio C HamanoApr 27, 2007
  6. Ismail DönmezMay 1, 2007
  7. Junio C HamanoMay 1, 2007
  8. Ismail DönmezMay 1, 2007
  9. Ismail DönmezMay 1, 2007
  10. Ismail DönmezMay 3, 2007
  11. Junio C HamanoMay 3, 2007
  12. Alexandre JulliardJun 1, 2007
  13. Ismail DönmezJun 1, 2007
  14. Alexandre JulliardJun 1, 2007
  15. Junio C HamanoJun 1, 2007
  16. Ismail DönmezJun 1, 2007
  17. Junio C HamanoJun 1, 2007
  18. Ismail DönmezJun 1, 2007
  19. Junio C HamanoJun 3, 2007
  20. Ismail DönmezJun 3, 2007
  21. Jakub NarebskiJun 2, 2007

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.