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

Re: [PATCH v2] macos: lazily initialize iconv

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jul 31, 2012, 19:51 UTC
Message-ID
<CA+55aFwE93YeVjZp9VLhRvbxFJNonafmUE6rHzPer5hv-hON5Q@mail.gmail.com>
In-Reply-To
<7v1ujrkc9p.fsf@alter.siamese.dyndns.org>
On Tue, Jul 31, 2012 at 11:37 AM, Junio C Hamano <gitster@pobox.com> wrote:
>
>  * This is not even compile tested, so it needs testing and
>    benchmarking, as I do not even know how costly the calls to
>    open/close are when we do not have to call iconv() itself.
Ok, so it's easily compile-tested: just add
+       COMPAT_OBJS += compat/precompose_utf8.o
+       BASIC_CFLAGS += -DPRECOMPOSE_UNICODE
to the makefile for Linux too.

Actually testing how well it *works* is hard, since I don't really have a mac (well, I do, but it no longer has OS X on it ;), and the whole "utf-8-mac" thing does not make sense.

HOWEVER. I actually tested it with the conversion being from Latin1 to UTF-8 instead, and it does interesting things, and kind of works. I say "kind of", because for the case of the filesystem being in Latin1, we actually have to convert things back to the filesystem character set when doing "open()" and "lstat()", and this patch obviously doesn't do that, because OS X does the conversion back to NFD on its own.

But ACK on the patch.
If I had more time, I'd actually be interested to do the generic case
of namespace conversion, and we could make this a generic git feature
- it's something I wanted to do long ago. However, right now I'm in
the merge window and will go on a vacation to Finland after that, so I
probably won't get around to it.

I do have one suggestion: please rename the "has_utf8()" function to "has_nonascii()" too. Why? Because that's what the function actually does. It has nothing to do with testing for UTF-8 (the utf-8 rules are more complex than just "high bit set"), and *if* I ever get around to doing a more generic character set conversion for the filenames, the decision really would be about non-ASCII, not about non-UTF8.

              Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 8 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.