BUG: %lc in printf fails with transliteration
Ulrich Drepper
drepper@redhat.com
Mon Sep 25 08:23:00 GMT 2000
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 `------------------------
More information about the Libc-alpha
mailing list