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

Re: [JGIT] maven build fails on OS X

From
Nigel Magnay <nigel.magnay@gmail.com>
Date
Feb 6, 2009, 21:12 UTC
Message-ID
<320075ff0902061312i1b2d960ax34bb992d8ba85fc5@mail.gmail.com>
In-Reply-To
<200902062154.34997.robin.rosenberg.lists@dewire.com>
Show 12 quoted lines
> Here we intend to feed the dequote an ISO-Latin encoded string. Our decoder
> will first try to decode it as UTF-8, which should fail, then we try to decode it
> as the platform default (Linear A, Hieroglyphs, MacRoman or something not
> known to living mankind). A problem is that Git *forces* us to guess the encoding,
> and in some situations you'd need human intelligence to figure it out. Software
> with a little more hindsight recognize this and declare UTF-8 to be the one
> and only encoding. JGit always encodes things as UTF-8 for this reason, but
> we cannot trust the input. These test cases are supposed to prove that we
> can guess things correctly at least some of the time.. Using "platform
> default" may be the wrong thing if it does not match what a C Git user on
> this platform would encounter.
>

I got your reply exaclty as I found the same thing :-). I'm not sure that this is the common cause of all test failures, but it is for testGetText_DiffCc :-

When it parses the first string in extractFileLines, it passes to RawParseUtils.decode which, as you outlined, does a "Try UTF-8, Try caller suggestion, try Charset.defaultCharset(), then finally back out to ISO-8859-1.

On most platforms, this is Try UTF-8 (fail), caller suggestion (also UTF-8, skip), try default (UTF-8, skip) - finally parse ISO-8859-1.

On the mac, this is Try UTF-8 (fail), caller suggestion (UTF-8, skip), try default (MacRoman) --> succeed.

I'm less clear on what the right way to fix it is (or if it's just the tests that need to somehow force the system file.encoding?

Previous: Robin Rosenberg
Message 6 of 6 in “[JGIT] maven build fails on OS X”
  1. Nigel MagnayFeb 6, 2009
  2. Shawn O. PearceFeb 6, 2009
  3. Nigel MagnayFeb 6, 2009
  4. Robin RosenbergFeb 6, 2009
  5. Robin RosenbergFeb 6, 2009
  6. Nigel MagnayFeb 6, 2009

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.