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

Re: [PATCH] macos: lazily initialize iconv

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 31, 2012, 18:19 UTC
Message-ID
<7v6293kd2y.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CAN0XMOL6m0B0bLwdp9mviOLqYORGcnf9LMS5=+WkXhGinBrzgA@mail.gmail.com>
Ralf Thielow <ralf.thielow@gmail.com> writes:
Show 16 quoted lines
> On Tue, Jul 31, 2012 at 7:52 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> +       /* Avoid iconv_open()/iconv_close() if there is nothing to convert */
>> +       for (i = 0; i < argc; i++) {
>> +               if (has_utf8(argv[i], (size_t)-1, NULL))
>> +                       break;
>> +       }
>> +       if (i < argc)
>> +               return;
>> +
>
> I'm not very familiar with this code but:
>
> before: it reencodes everything which is utf-8 in argv
> after: it reencodes *nothing* if one string in argv is not in utf-8
>
> am i wrong?

You are right. It should avoid the whole iconv thing if we saw _no_ utf8, i.e. the last two should be:

	if (argc <= i)
        	return;
Thanks.
Previous: Ralf ThielowNext: Junio C Hamano
Message 4 of 15 in “macos: lazily initialize iconv”
  1. macos: lazily initialize iconvJunio C Hamano, Jul 31, 2012
  2. Junio C HamanoJul 31, 2012
  3. Ralf ThielowJul 31, 2012
  4. Junio C HamanoJul 31, 2012
  5. macos: lazily initialize iconvJunio C Hamano, Jul 31, 2012
  6. Ralf ThielowJul 31, 2012
  7. Junio C HamanoJul 31, 2012
  8. Linus TorvaldsJul 31, 2012
  9. Junio C HamanoJul 31, 2012
  10. Linus TorvaldsJul 31, 2012
  11. Torsten BögershausenAug 1, 2012
  12. Torsten BögershausenAug 10, 2012
  13. Junio C HamanoAug 10, 2012
  14. Torsten BögershausenAug 10, 2012
  15. Junio C HamanoAug 10, 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.