Re: [PATCH] diff-highlight: Fix broken multibyte string
- From
Jeff King <peff@peff.net>
- Date
- Apr 3, 2015, 21:47 UTC
- Message-ID
- <20150403214729.GA11220@peff.net>
- In-Reply-To
- <1D1557A9-737A-4BF6-A3DE-BF4C0465BD36@gmail.com>
On Thu, Apr 02, 2015 at 06:59:50PM -0700, Kyle J. McKay wrote:
Show 5 quoted lines
> It should work as well as the original did for any 1-byte encoding. That > is, if it's not valid UTF-8 it should pass through unchanged and any single > byte encoding should just work. But, as you point out, multibyte encodings > other than UTF-8 won't work, but they should behave the same as they did > before.
Yeah, sorry, I should have been more clear that I meant multibyte encodings. UTF-8 is the only common multibyte encoding I run across, but that's because Latin1 served most of my pre-UTF-8 needs. I suspect things are very different for people in Asia. I don't know how badly they would want support for other encodings. I'm happy to go with a UTF-8 solution for now, and see if anybody wants to expand it further later.
> >I timed this one versus the existing diff-highlight. It's about 7% > >slower. > > I'd expect that, we're doing extra work we weren't doing before.
I was worried would be 200% or something. :)
> >Makes sense. I'm happy enough listing perl 5.8 as a dependency. > > Maybe that should be added. The rest of Git's perl code seems to have a > 'use 5.008;' already, so I figured that was a reasonable dependency. :)
I shouldn't have said "listing". I just meant "have" as a dependency. I am also happy with adding "use 5.008", but I agree it's probably not necessary at this point. It was released in 2002 (wow, has it really been that long?).
-Peff