[Bug 296764] iconv_open() accepts but does not implement //NON_IDENTICAL_DISCARD
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Tue, 14 Jul 2026 00:55:31 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=296764
Bug ID: 296764
Summary: iconv_open() accepts but does not implement
//NON_IDENTICAL_DISCARD
Product: Base System
Version: CURRENT
Hardware: Any
OS: Any
Status: New
Severity: Affects Only Me
Priority: ---
Component: bin
Assignee: bugs@FreeBSD.org
Reporter: michael@orlitzky.com
FreeBSD's iconv_open() will accept any of the magic //SUFFIX indicators
appended to the destination codeset and discards all but //IGNORE:
https://cgit.freebsd.org/src/tree/lib/libc/iconv/bsd_iconv.c#n60
As the codeset names themselves are implementation-defined, this is usually not
a problem, because your implementation defines them to do nothing :)
POSIX 2024 however specifies a new suffix, //NON_IDENTICAL_DISCARD:
https://pubs.opengroup.org/onlinepubs/9799919799/functions/iconv_open.html
As a result, accepting but not implementing that particular suffix may lead to
confusion. It is probably better to return EINVAL from iconv_open() in that
case, to indicate that the suffix is "unrecognized or not supported."
The iconv(3) man page refers to an older version of POSIX, so the documentation
and implementation are not in error, but sooner or later people are going to
start using this suffix and be surprised. A strcmp and return EINVAL would make
it not your problem.
--
You are receiving this mail because:
You are the assignee for the bug.