View Issue Details

IDProjectCategoryView StatusLast Update
00019701003.1(2013)/Issue7+TC1Shell and Utilitiespublic2026-01-22 07:39
Reporterstephane Assigned To 
PrioritynormalSeverityEditorialTypeClarification Requested
Status NewResolutionOpen 
NameStephane Chazelas
Organization
User Reference
Sectioniconv utility
Page Number(page or range of pages)
Line Number(Line or range of lines)
Interp Status
Final Accepted Text
Summary0001970: exit status unclear for iconv -c on invalid input
DescriptionThe iconv utility specification has:

> The presence or absence of -c shall not affect the exit status of iconv.

Which suggests that iconv should return the same exit status with -c that it should without.

But the exit status section has:

> >0
> An error occurred.

Which seems to be in contradiction.

AFAICT, both the iconv that comes with GNU libc and GNU libiconv exit with status 1 and no error message in:

printf '\303\n' | iconv -c -f UTF-8

For instance and the one from FreeBSD gives no error and exit with 0.

I've not tested other implementations.

BTW, all three implementations exit with 1 and report an error message when the decoding error is found at the end (like in printf '\303' | iconv -c -f UTF-8), which seems to be in breach of the POSIX specification. Not sure whether that's intentional or not.
Desired ActionMaybe change the exit status section to:

>0 An error occurred or would have occurred in the absence of -c.
TagsNo tags attached.

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2026-01-22 07:39 stephane New Issue