From: Jeff King <peff@peff.net>
To: "brian m. carlson" <sandals@crustytoothpaste.net>,
Lars Schneider <larsxschneider@gmail.com>,
Steve Groeger <GROEGES@uk.ibm.com>,
git@vger.kernel.org
Subject: Re: Use of new .gitattributes working-tree-encoding attribute across different platform types
Date: Mon, 2 Jul 2018 14:17:42 -0400 [thread overview]
Message-ID: <20180702181742.GA12208@sigill.intra.peff.net> (raw)
In-Reply-To: <20180701175657.GC7965@genre.crustytoothpaste.net>
On Sun, Jul 01, 2018 at 05:56:58PM +0000, brian m. carlson wrote:
> On Thu, Jun 28, 2018 at 01:27:07PM -0400, Jeff King wrote:
> > Yeah, that was along the lines that I was thinking. I wonder if anybody
> > would ever need two such auto-encodings, though. Probably not. But
> > another way to think about it would be to allow something like:
> >
> > working-tree-encoding=foo
> >
> > and then in your config "foo" to map to some encoding.
> >
> > But that may be over-engineering, I dunno. utf8 has always been enough
> > for me. :)
>
> I had a thought the other day about why this solution might be valuable.
> Different platforms encode different values for iconv character sets.
> So, for example, one may have platforms supporting some disjoint sets of
> the following:
>
> * LATIN-1
> * LATIN1
> * ISO8859-1
> * ISO-8859-1
> * ISO_8859-1
> * ISO_8859-1:1987
> * some lowercase variants of these
>
> Therefore, specifying a working-tree-encoding value that works across a
> wide variety of system may be non-trivial. This is less of a problem
> with UTF-8, but having the ability to pick an encoding and remap it to a
> supported value may be useful nevertheless.
One thing I almost did in the example I gave above was to literally call
the encoding name by a "real" one. I.e.:
echo '*.txt working-tree-encoding=iso-8859-1' >.gitattributes
git config encoding.iso-8859-1.replace latin1
or something. But I wondered if it was a little crazy as a practice,
since mapping "iso-8859-1" to "utf-8" is probably going to lead to
headaches.
But your example above of semantically equivalent variants with
different spellings would be a good use of that trick.
It also makes me wonder if there's another layer of indirection
somewhere in the iconv machinery we could be taking advantage of to
accomplish the same thing. Probably not conveniently or portably, I
guess.
-Peff
next prev parent reply other threads:[~2018-07-02 18:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-27 7:54 Use of new .gitattributes working-tree-encoding attribute across different platform types Steve Groeger
2018-06-27 17:38 ` Torsten Bögershausen
2018-06-28 2:44 ` brian m. carlson
2018-06-28 14:34 ` Jeff King
2018-06-28 17:21 ` Lars Schneider
2018-06-28 17:27 ` Jeff King
2018-07-01 17:56 ` brian m. carlson
2018-07-02 18:17 ` Jeff King [this message]
2018-07-03 16:01 ` Junio C Hamano
2018-07-02 12:13 ` Steve Groeger
2018-07-02 14:09 ` Lars Schneider
2018-07-02 18:20 ` Jeff King
-- strict thread matches above, loose matches on Subject: below --
2018-06-27 7:50 Steve Groeger
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=20180702181742.GA12208@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=GROEGES@uk.ibm.com \
--cc=git@vger.kernel.org \
--cc=larsxschneider@gmail.com \
--cc=sandals@crustytoothpaste.net \
/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).