Re: [PATCH] contrib/diff-highlight: multibyte characters diff
- From
Thomas Adam <thomas@xteddy.org>
- Date
- Feb 12, 2014, 23:10 UTC
- Message-ID
- <CA+39Oz5TSPNzYVvFytJwwUhRYjbEp5f_BdBWKT2tcYzpbF1WyQ@mail.gmail.com>
- In-Reply-To
- <20140212205948.GA4453@sigill.intra.peff.net>
On 12 February 2014 20:59, Jeff King <peff@peff.net> wrote:
> +sub decode {
> + my $orig = shift;
> + my $decoded = eval { decode_utf8($orig, Encode::FB_CROAK) };
> + return defined $decoded ?I'd still advocate checking $@ here, rather than the defined $decoded check.
> + ($decoded, sub { encode_utf8(shift) }) :
> + ($orig, sub { shift });
> +}
> +-- Thomas Adam