Re: [PATCH ] t4210-log-i18n: spell encoding name "UTF-8" correctly
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 25, 2013, 19:06 UTC
- Message-ID
- <7vmwusxlfm.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <20130225151916.GA7725@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 27 quoted lines
> ... I think the simplest thing would just be: > > diff --git a/utf8.c b/utf8.c > index 1087870..8d42b50 100644 > --- a/utf8.c > +++ b/utf8.c > @@ -507,6 +507,17 @@ char *reencode_string(const char *in, const char *out_encoding, const char *in_e > > if (!in_encoding) > return NULL; > + > + /* > + * Some platforms do not have the variously spelled variants of > + * UTF-8, so let us feed iconv the most official spelling, which > + * should hopefully be accepted everywhere. > + */ > + if (is_encoding_utf8(in_encoding)) > + in_encoding = "UTF-8"; > + if (is_encoding_utf8(out_encoding)) > + out_encoding = "UTF-8"; > + > conv = iconv_open(out_encoding, in_encoding); > if (conv == (iconv_t) -1) > return NULL; > > Does that fix the tests for you? It's a larger change, but I think it > makes git friendlier all around for people on Windows.
Yeah, if this is confirmed to work OK (from eyeballing I do not see a reason why not...) I agree this is the cleanest way forward.