|
From: | Michael Felt |
Subject: | Re: [bug-gettext] make check with gettext-0.19.6 and 0.19.5 fails more than compared to 0.19.4 |
Date: | Tue, 19 Apr 2016 20:41:56 +0200 |
On 2015-10-23 20:28, aixtools wrote:On 2015-10-23 20:09, aixtools wrote:The AIX libiconv.a is considered "unsuitable" because it returns a one-byte string (" ") for the Unicode conversion of the Euro-Symbol.
FAIL: msgcat-2
==============
msgcat: Cannot convert from "ISO-8859-1" to "UTF-8". msgcat relies on iconv(). This version was built without iconv().
FAIL msgcat-2 (exit status: 1)
While this may be your choice - calling it a "bug" is not accurate - as the official (looking) standard documentation (see http://pubs.opengroup.org/onlinepubs/009695399/functions/iconv.html)
states:
If iconv() encounters a character in the input buffer that is valid, but for which an identical character does not exist in the target codeset, iconv() shall perform an implementation-defined conversion on this character.
RETURN VALUE
The iconv() function shall update the variables pointed to by the arguments to reflect the extent of the conversion and return the number of non-identical conversions performed. If the entire string in the input buffer is converted, the value pointed to by inbytesleft shall be 0. If the input conversion is stopped due to any conditions mentioned above, the value pointed to by inbytesleft shall be non-zero and errno shall be set to indicate the condition. If an error occurs, iconv() shall return (size_t)-1 and set errno to indicate the error.
ERRORS
The iconv() function shall fail if:
- [EILSEQ]
- Input conversion stopped due to an input byte that does not belong to the input codeset.
- [E2BIG]
- Input conversion stopped due to lack of space in the output buffer.
- [EINVAL]
- Input conversion stopped due to an incomplete character or shift sequence at the end of the input buffer.
The iconv() function may fail if:
- [EBADF]
- The cd argument is not a valid open conversion descriptor.
What I specifically see as an official reason for returning an error - that is required! is when there is an error in the INPUT string. And specifically, when it does not exist in the output, aka target codeset - it is implementation defined - and AIX (read the IBM architect way back when) implemented as a blank space.
This is, it seems, not what GNU, or GETTEXT wants to see, but it is not a bug - just different. Documenting that way will save people like myself mucho troubles - AND - to be generous to AIX, Solaris, and HP-UX who all seem to have something to fall over in that text - a switch to permit "the consequences" would be generous.
The standards people had their reasons to let it be implementation defined - just do not ask me what they were.
Sincerely,
Michael
[Prev in Thread] | Current Thread | [Next in Thread] |