git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Robin Rosenberg <robin.rosenberg.lists@dewire.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: Re: [JGIT PATCH 2/2] Add getPatchText functions to obtain the plain-text version of a patch
Date: Sat, 13 Dec 2008 22:26:47 +0100	[thread overview]
Message-ID: <200812132226.47815.robin.rosenberg.lists@dewire.com> (raw)
In-Reply-To: <200812131202.07717.robin.rosenberg.lists@dewire.com>

lördag 13 december 2008 12:02:07 skrev Robin Rosenberg:
> lördag 13 december 2008 03:42:26 skrev Shawn O. Pearce:
> > The conversion from byte[] to String is performed one line at a time,
> > in case the patch is a character encoding conversion patch for the
> > file.  For simplicity we currently assume UTF-8 still as the default
> > encoding for any content, but eventually we should support using the
> > .gitattributes encoding property when performing this conversion.
> 
> For usefulness we must be able to pass the encoding from outside, 
> e.g. the encoding Eclipse uses, which often is not UTF-8-

It's even worse. You should probably do the encoding guess on the whole
patch, or per file and not per line so make success possible at all. Reading
and writing as ISO-8859-1 will always work as that is just padding every
byte with NUL on reading and dropping it on writing. I.e. if your convert
to char at all...

-- robin

  reply	other threads:[~2008-12-13 21:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-13  2:42 [JGIT PATCH 1/2] Add raw buffer fetch methods to FileHeader, HunkHeader Shawn O. Pearce
2008-12-13  2:42 ` [JGIT PATCH 2/2] Add getPatchText functions to obtain the plain-text version of a patch Shawn O. Pearce
2008-12-13 11:02   ` Robin Rosenberg
2008-12-13 21:26     ` Robin Rosenberg [this message]
2008-12-17 20:13       ` [JGIT PATCH 2/2 v2] Add getScriptText " Shawn O. Pearce

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=200812132226.47815.robin.rosenberg.lists@dewire.com \
    --to=robin.rosenberg.lists@dewire.com \
    --cc=git@vger.kernel.org \
    --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).