So the comment suggest that if `iconv' returns a positive integer
it will be a lossy conversion.
And this is exactly the place where the conversion fails.
However, the conversion from the string "ABC" is not lossy.
Also reading the documentation of `iconv' it says:
----------------------
If all input from the input buffer is successfully converted and
stored in the output buffer the function returns the number of
conversions performed. In all other cases the return value is
`(size_t) -1' and `errno' is set appropriately. In this case the
value pointed to by INBYTESLEFT is nonzero.
----------------------
So this suggest it will return the number of successfull converted
characters. This is consistent with the values I see.
This suggests to me that the code in Unicode.m is wrong, or
that there are two incompatible versions of iconv and I managed
to use the wrong one.
Also, if the intention is to check for lossy conversion, the relevant
part of the iconv documentation is:
---------------------
Since the character sets selected in the `iconv_open' call can be
almost arbitrary there can be situations where the input buffer
contains valid characters which have no identical representation
in the output character set. The behavior in this situation is
undefined. The _current_ behavior of the GNU C library in this
situation is to return with an error immediately. This certainly
is not the most desirable solution. Therefore future versions
will provide better ones but they are not yet finished.
--------------------
It might also be convenient to know that I am using
(g)libc-2.1.1