View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0001970 | 1003.1(2013)/Issue7+TC1 | Shell and Utilities | public | 2026-01-22 07:39 | 2026-01-22 07:39 |
| Reporter | stephane | Assigned To | |||
| Priority | normal | Severity | Editorial | Type | Clarification Requested |
| Status | New | Resolution | Open | ||
| Name | Stephane Chazelas | ||||
| Organization | |||||
| User Reference | |||||
| Section | iconv utility | ||||
| Page Number | (page or range of pages) | ||||
| Line Number | (Line or range of lines) | ||||
| Interp Status | |||||
| Final Accepted Text | |||||
| Summary | 0001970: exit status unclear for iconv -c on invalid input | ||||
| Description | The 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 Action | Maybe change the exit status section to: >0 An error occurred or would have occurred in the absence of -c. | ||||
| Tags | No tags attached. | ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-01-22 07:39 | stephane | New Issue |