bug-gnulib
[Top][All Lists]
Advanced

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

Re: strftime updates


From: Jim Meyering
Subject: Re: strftime updates
Date: Sun, 18 Jan 2009 23:12:14 +0100

Bruno Haible <address@hidden> wrote:
> How about the other small cleanups that I mentioned in
>   <http://lists.gnu.org/archive/html/bug-gnulib/2009-01/msg00012.html>?
> Here is a proposed patch. The comment in glibc ("The GNU C Library uses UTF8
> multibyte encoding") is actually wrong, since glibc supports locales in
> BIG5, GB18030, etc. - like other platforms.
>
> 2009-01-18  Bruno Haible  <address@hidden>
>
>       * m4/strftime.m4 (gl_FUNC_STRFTIME): Don't test for mblen and mbrlen.
>       * lib/strftime.c (HAVE_MBLEN, HAVE_MBRLEN): Remove macros.
>       (MULTIBYTE_IS_FORMAT_SAFE): Define to 1 on all platforms except OSF/1.
...
> +   conversion specifications.  The multibyte encodings used by the
> +   C library on the various platforms (UTF-8, GB2312, GBK, CP936,
> +   GB18030, EUC-TW, BIG5, BIG5-HKSCS, CP950, EUC-JP, EUC-KR, CP949,
> +   SHIFT_JIS, CP932, JOHAB) are safe for formats, because the byte '%'
> +   cannot occur in a multibyte character except in the first byte.
> +   But this does not hold for the DEC-HANYU encoding used on OSF/1.  */
> +#if !defined __osf__
> +# define MULTIBYTE_IS_FORMAT_SAFE 1
> +#endif
> +#define DO_MULTIBYTE (! MULTIBYTE_IS_FORMAT_SAFE)

That looks fine.  Thanks!
Please push it.

However, while I'm dubious of the value of accommodating
what I suspect is a rarely used encoding (DEC-HANYU) that is
available only on a borderline target (osf), I suppose it's a
good excuse for keeping the DO_MULTIBYTE code that could otherwise
be removed.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]