GNU bug report logs - #17221
[PATCH] grep: port better to hosts with nonstandard nl_langinfo

Previous Next

Package: grep;

Reported by: Paul Eggert <eggert <at> CS.UCLA.EDU>

Date: Tue, 8 Apr 2014 15:07:02 UTC

Severity: normal

Tags: patch

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 17221 <at> debbugs.gnu.org (full text, mbox):

From: Jim Meyering <jim <at> meyering.net>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 17221 <at> debbugs.gnu.org
Subject: Re: bug#17221: [PATCH] grep: port better to hosts with nonstandard
 nl_langinfo
Date: Tue, 8 Apr 2014 10:41:51 -0700
On Tue, Apr 8, 2014 at 8:04 AM, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
> On some hosts, nl_langinfo returns strings other than "UTF-8" when
> UTF-8 is used, and (worse) return "UTF-8" even if the encoding is
> single-byte.  Work around these problems by trying a sample
> character instead.
> * src/dfa.c, src/pcresearch.c, src/searchutils.c:
> Don't include <langinfo.h>.
> * src/dfa.c (using_utf8): Test for UTF-8 by trying a character
> rather than by invoking nl_langinfo (CODESET); this is more
> portable in practice, and removes a dependency on
> HAVE_LANGINFO_CODESET.
> * src/pcresearch.c: Include dfa.h, for using_utf8.
> (Pcompile): Use using_utf8 rather than nl_langinfo.

Nicely done.  And thanks for handling so many of Norihiro's patches.




This bug report was last modified 11 years and 105 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.