[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: address@hidden: Re: [PATCH] I18n flag for msgfmt]
From: |
Bruno Haible |
Subject: |
Re: address@hidden: Re: [PATCH] I18n flag for msgfmt] |
Date: |
Wed, 7 Jan 2004 13:34:16 +0100 |
User-agent: |
KMail/1.5 |
Paul Eggert wrote:
> That goes a bit too far, as "%d" is sometimes correct regardless of
> locale. For example, POSIX requires that plain "diff" must use %d for
> line numbers, regardless of locale...
It's normal: "diff"'s output is meant as input to other programs. However,
gettext is mostly used by programs whose output is directed to end users.
> For example, there's no portable way
> to print off_t values using printf (until we can assume C99
> everywhere), so many applications use their own code that divide by 10
> and print the off_t values directly. If gettext were to support the
> C99 printf formats (even on non-C99 hosts), that would address much of
> this problem, but it raises other problems and I worry that we may be
> trying to fold too much functionality into gettext.
I agree: People should not need to use <libintl.h> just in order to use
off_t values in printf(). Programs that want to print off_t values and at
the same time be portable should IMO cast the off_t value to intmax_t and
use PRIdMAX from <inttypes.h> (or an <inttypes.h> substitute).
Bruno