iconv.3: Upstream useful NOTE from Debian

Warn the reader that the pointer arguments can't be
interpreted as C style strings. Also, note possible
alignment requirements for the referenced bytes sequences,

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2012-05-04 09:52:09 +12:00
parent f9b75bd469
commit 2d17a61d47
1 changed files with 19 additions and 0 deletions

View File

@ -139,6 +139,25 @@ An incomplete multibyte sequence has been encountered in the input.
This function is available in glibc since version 2.1.
.SH "CONFORMING TO"
POSIX.1-2001.
.SH NOTES
Although
.I inbuf
and
.I outbuf
are typed as
.IR "char\ **" ,
this does not mean that the objects they point can be interpreted
as C strings or as arrays of characters:
the interpretation of character byte sequences is
handled internally by the conversion functions.
In some encodings, a zero byte may be a valid part of a multibyte character.
The caller of
.BR iconv ()
must ensure that the pointers passed to the function are suitable
for accessing characters in the appropriate character set.
This includes ensuring correct alignment on platforms that have
tight restrictions on alignment.
.SH "SEE ALSO"
.BR iconv_close (3),
.BR iconv_open (3)