git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nigel Magnay <nigel.magnay@gmail.com>
To: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
Cc: "Shawn O. Pearce" <spearce@spearce.org>, Git ML <git@vger.kernel.org>
Subject: Re: [JGIT] maven build fails on OS X
Date: Fri, 6 Feb 2009 21:12:29 +0000	[thread overview]
Message-ID: <320075ff0902061312i1b2d960ax34bb992d8ba85fc5@mail.gmail.com> (raw)
In-Reply-To: <200902062154.34997.robin.rosenberg.lists@dewire.com>

> 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?

      reply	other threads:[~2009-02-06 21:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-06 15:08 [JGIT] maven build fails on OS X Nigel Magnay
2009-02-06 15:31 ` Shawn O. Pearce
2009-02-06 20:08   ` Nigel Magnay
2009-02-06 21:07     ` Robin Rosenberg
2009-02-06 20:54   ` Robin Rosenberg
2009-02-06 21:12     ` Nigel Magnay [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=320075ff0902061312i1b2d960ax34bb992d8ba85fc5@mail.gmail.com \
    --to=nigel.magnay@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=robin.rosenberg.lists@dewire.com \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).