On the other hand, I have great difficulty to envision a real-world
situation, where the user of iconv
- knows that the input is zero terminated
- does not know whether this is an 8-bit, 16-bit or 32-bit
wide and aligned zero
Perhaps hes writing a function which wraps iconv, and converts
zero-terminated strings from any encoding. The knowledge of how
to detect a null in a stateful encoding is not necessarily trivial.
If there was a function which could return the unit-word-size of
any encoding accepted by iconv, then it would be possible to make
an assumption that null words are never non-terminal in any stateful
encoding.
He might simply have to require the length as an argument in
any such wrapping function.
--
Linux-UTF8: i18n of Linux on all levels
Archive: http://mail.nl.linux.org/linux-utf8/