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

Re: [PATCH 1/2] utf8: refactor code to decide fallback encoding

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 27, 2016, 15:33 UTC
Message-ID
<xmqqvaxhqrwd.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20160927055202.4ucddki3xkns45om@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> But once we introduce other fallbacks, then "utf8 -> latin1" may become
> "UTF-8 -> iso8859-1". A system that knows only "utf8" and "iso8859-1"
> _could_ work if we turned the knobs individually, but won't if we turn
> them both at once. Worse, a system that knows only "UTF-8" and "latin1"
> works now, but would break with your patches.
>
> I'm not convinced it's worth worrying about, though. The existence of
> such a system is theoretical at this point. I'm not even sure how common
> the "know about utf8 but not UTF-8" thing is, or if we were merely being
> overly cautious.

Yeah, I did consider having to try the permutations until it works, but suspecting that somebody takes "utf8" without taking "UTF-8" is to pretty much invalidate the basic premise of the existing code, i.e. spelling it as "UTF-8" is the most likely to work anywhere as long as UTF-8 is supported, so I stopped worrying about it at that point.

I'd actually welcome a more generic suggestions we can put in our documentation so that we can _lose_ the fallback entirely (e.g. "if your contributor spelled 'utf8' and your system, which does take 'UTF-8', does not like it, then here is what you can do to your /etc/locale.alias").

Previous: Jeff KingNext: Junio C Hamano
Message 4 of 7 in “Locally alias "latin-1" to "ISO-8859-1"”
  1. 0/2 Locally alias "latin-1" to "ISO-8859-1"Junio C Hamano, Sep 27, 2016
  2. 1/2 utf8: refactor code to decide fallback encodingJunio C Hamano, Sep 27, 2016
  3. Jeff KingSep 27, 2016
  4. Junio C HamanoSep 27, 2016
  5. 2/2 utf8: accept "latin-1" as ISO-8859-1Junio C Hamano, Sep 27, 2016
  6. Jeff KingSep 27, 2016
  7. Junio C HamanoSep 27, 2016

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.