tags 606899 fixed-upstream thanks On Sun, Dec 12, 2010 at 9:36 PM, brian m. carlson <[email protected]> wrote: > Package: manpages-dev > Version: 3.27-1 > Severity: minor > Tags: patch > > btowc(3) says: > > This function should never be used. It does not work for encodings > which have state, and unnecessarily treats single bytes differently > from multibyte sequences. Use the function mbtowc() instead. > > but mbtowc(3) says: > > The function mbrtowc(3) provides a better interface to the same > functionality. > > Obviously, btowc(3) should not suggest a non-optimal interface; it > should instead suggest mbrtowc. This is also true for the pair wctob(3) > and wctomb(3). A patch is attached to fix both manpages to suggest the > preferable functions.
Brian, Thanks for this report. For upstream 3.34, I applied a somewhat different patch, which probably will satisfy your concerns. Cheers, Michael diff --git a/man3/btowc.3 b/man3/btowc.3 index dde646b..c3b49a1 100644 --- a/man3/btowc.3 +++ b/man3/btowc.3 @@ -58,9 +58,12 @@ This function should never be used. It does not work for encodings which have state, and unnecessarily treats single bytes differently from multibyte sequences. -Use the function -.BR mbtowc () +Use either +.BR mbtowc (3) +or the thread-safe +.BR mbrtowc (3) instead. .SH "SEE ALSO" .BR mbtowc (3), +.BR mbrtowc (3), .BR wctob (3) diff --git a/man3/wctob.3 b/man3/wctob.3 index 59f5fcd..7f98786 100644 --- a/man3/wctob.3 +++ b/man3/wctob.3 @@ -56,6 +56,12 @@ distinguish single-byte and multibyte characters. Use the function .BR wctomb (3) instead. +Use either +.BR wctomb (3) +or the thread-safe +.BR wcrtomb (3) +instead. .SH "SEE ALSO" .BR btowc (3), +.BR wcrtomb (3), .BR wctomb (3) -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Author of "The Linux Programming Interface"; http://man7.org/tlpi/ -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

