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

Re: [JGIT PATCH 4/4] Intelligent parsing of ambiguously encoded meta data.

From
Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Date
Oct 13, 2008, 17:10 UTC
Message-ID
<200810131910.53891.robin.rosenberg.lists@dewire.com>
In-Reply-To
<20081013022708.GJ4856@spearce.org>
måndagen den 13 oktober 2008 04.27.08 skrev Shawn O. Pearce:
Show 16 quoted lines
> Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> > We cannot trust meta data to be encoded in any particular way, so we try
> > different encodings. First we try UTF-8, which is the only sane encoding
> > for non-local data, even when used in regions where eight bit legacy
> > encodings are common. The chance of mistakenly parsing non-UTF-8 data
> > as valid UTF-8 is varies from extremely low (western encodings) to low
> > for most other encodings. If the data does not look like UTF-8, we try the
> > suggested encoding. If that fails we try the user locale and finally, if
> > that fails we try ISO-8859-1, which cannot fail.
> 
> Hmm.  I'm concerned about the infinite loop you have here.
> If ISO-8859-1 fails we'd be stuck here until the end of time.
> Plus its a bit ugly to read.
> 
> I wonder if this is any better.  It passes your tests and is 2
> lines shorter.
Yes. Not sure what I was thinking with the loop there... :)
-- robin
Previous: Shawn O. PearceNext: Shawn O. Pearce
Message 7 of 8 in “Decodings”
  1. 0/4 DecodingsRobin Rosenberg, Oct 12, 2008
  2. 1/4 log command: Use explicit US locale for datesRobin Rosenberg, Oct 12, 2008
  3. 2/4 jgit programs: Use i18n.logOutputEncoding or user's locale for outputRobin Rosenberg, Oct 12, 2008
  4. 3/4 The git config file is case insensitiveRobin Rosenberg, Oct 12, 2008
  5. 4/4 Intelligent parsing of ambiguously encoded meta data.Robin Rosenberg, Oct 12, 2008
  6. Shawn O. PearceOct 13, 2008
  7. Robin RosenbergOct 13, 2008
  8. Shawn O. PearceOct 13, 2008

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.