Re: [PATCH ] t4210-log-i18n: spell encoding name "UTF-8" correctly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Feb 25, 2013 at 07:54:47PM +0100, Torsten Bögershausen wrote:

> (beside that I couldn't find t4210 somewhere),

It's newly added in 04deccd.

> diff --git a/utf8.c b/utf8.c
> index a4ee665..e9850d0 100644
> --- a/utf8.c
> +++ b/utf8.c
> @@ -487,6 +487,10 @@ char *reencode_string(const char *in, const char *out_encoding, const char *in_e
>  	if (!in_encoding)
>  		return NULL;
>  	conv = iconv_open(out_encoding, in_encoding);
> +	if (conv == (iconv_t) -1 && errno == EINVAL) {
> +		conv = iconv_open(is_encoding_utf8(out_encoding) ? "UTF-8" : out_encoding,
> +											is_encoding_utf8(in_encoding) ? "UTF-8" : in_encoding);
> +	}

Yeah, I think this is pretty close to the patch I just sent. You do the
fallback, which I think is sane to prevent any possible regression (for
"type 3" systems, as I called them in my commit). I don't know if it is
worth checking errno; we should get the same failure either way, and I'd
worry slightly about some odd iconv implementation does not use EINVAL.

And of course, I like my indentation and commit message better. :)

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]