This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: BUG: %lc in printf fails with transliteration
- To: Markus Kuhn <Markus dot Kuhn at cl dot cam dot ac dot uk>
- Subject: Re: BUG: %lc in printf fails with transliteration
- From: Ulrich Drepper <drepper at redhat dot com>
- Date: 25 Sep 2000 08:23:26 -0700
- Cc: libc-alpha at sources dot redhat dot com
- References: <E13dTzW-0007mA-00@wisbech.cl.cam.ac.uk>
- Reply-To: drepper at cygnus dot com (Ulrich Drepper)
Markus Kuhn <Markus.Kuhn@cl.cam.ac.uk> writes:
> It is disappointing to hear that the wc*tomb* cannot handle
> transliteration.
It is impossible with the wc*tomb* interface. wcrtomb and wcsrtombs
don't get the size of the input buffer passed and therefore the user's
allocation of a MB_CUR_MAX bytes sized buffer must be enough. But,
for instance for ASCII, MB_CUR_MAX is 1 and therefore we cannot
transliterate ö to oe.
> In addition, the C standard very clearly requires that
> (apart from the fwide() state issues)
>
> wint_t c = L'ü';
> printf("'%lc'\n", c);
>
> and
>
> wint_t c = L'ü';
> wprintf("'%lc'\n", c);
For well defined input. It is completely undefined what happens if
you pass invalid input. And ö in invalid in the C locale.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------