From 2d17a61d47b338f2dec186f570a523dca9e5afea Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Fri, 4 May 2012 09:52:09 +1200 Subject: [PATCH] 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 --- man3/iconv.3 | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/man3/iconv.3 b/man3/iconv.3 index 23e717b6f..c9f3e6f0e 100644 --- a/man3/iconv.3 +++ b/man3/iconv.3 @@ -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)