Re: [PATCH] t9129: fix UTF-8 locale detection
- From
Linus Torvalds <torvalds@linux-foundation.org>
- Date
- May 18, 2010, 17:45 UTC
- Message-ID
- <alpine.LFD.2.00.1005181037250.4195@i5.linux-foundation.org>
- In-Reply-To
- <1274203013-1349-1-git-send-email-yann@droneaud.fr>
On Tue, 18 May 2010, Yann Droneaud wrote:
> > -if locale -a |grep -q en_US.utf8; then > +if locale -a |grep -qE '^en_US\.(utf|UTF)-?8$'; then
While -E is POSIX, I suspect that it's not universal. iirc, you still have some really crap fileutils tools coming with Solaris, for example.
Wouldn't it be easier to just make it ignore case, and do
grep -qi '^en_US\.utf-?8$'
instead?
I'm also not entirely sure you want to make that pattern stricter - the whole problem with the old pattern was that it was too exact, so why add the beginning/end requirement?
Linus