From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5013D383FF6D; Fri, 16 Dec 2022 23:03:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5013D383FF6D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1671231809; bh=F9RjReO/+Mhh0DSrQxM0M+Rl6Usyrh1hhWAG15tkWdM=; h=From:To:Subject:Date:From; b=Tqlqydin+xoo095bg9eQVtYDaaKmzoG4d2AsNogVkcGtKjtW5Dmrfwsvn5uOso8XA R+gjeBLysYfBAfnifvAMEDRUDoAAqL3fZnMMECPnDAEUwr3hOHIGqOtFq5/dM1YuH2 7aWqiq5RDLfOlkoapngB4R43auCoZ0yMQFZ2+npw= From: "steffen at sdaoden dot eu" To: glibc-bugs@sourceware.org Subject: [Bug libc/29913] New: iconv(3) is not POSIX compliant, and does not conform to linux man-pages manual Date: Fri, 16 Dec 2022 23:03:28 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Version: 2.36 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: steffen at sdaoden dot eu X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D29913 Bug ID: 29913 Summary: iconv(3) is not POSIX compliant, and does not conform to linux man-pages manual Product: glibc Version: 2.36 Status: UNCONFIRMED Severity: normal Priority: P2 Component: libc Assignee: unassigned at sourceware dot org Reporter: steffen at sdaoden dot eu CC: drepper.fsp at gmail dot com Target Milestone: --- Disclaimer: i have reported this in the past but the issue was closed. The problem is that without //TRANSLIT GNU iconv(3) fails to perform the 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. POSIX iconv(3) (Vol. 2: System Interfaces, Issue 7) requirement. Instead GNU libc returns EILSEQ which is wrong as POSIX defined EILSEQ only= for [EILSEQ] Input conversion stopped due to an input byte that does not belo= ng to the input codeset. The Linux man-pages 6.01 manual (2022=E2=80=9010=E2=80=9009) says the same.= But GNU libc _does_ fail for EILSEQ without //TRANSLIT even if the input is valid UTF-8. As can be seen by running this (shortened variant of a config test program). I say "Bye!" already here, and hope it gets fixed! #include #include #include #include int main(void){ char inb[16], oub[16], *inbp, *oubp; iconv_t id; size_t inl, oul; int rv; memcpy(inbp =3D inb, "\341\203\276", sizeof("\341\203\276")); inl =3D sizeof("\341\203\276") -1; oul =3D sizeof oub; oubp =3D oub; rv =3D 1; if((id =3D iconv_open("us-ascii"/*//TRANSLIT"*/, "utf-8")) =3D=3D (iconv_t)-1) goto jleave; rv =3D 14; if(iconv(id, &inbp, &inl, &oubp, &oul) =3D=3D (size_t)-1) { fprintf(stderr, "error %s %d=3D=3D%d\n",strerror(errno),errno,errno=3D=3DEI= LSEQ); goto jleave; } fprintf(stderr, "bummer\n"); jleave: if(id !=3D (iconv_t)-1) iconv_close(id); return rv; } --=20 You are receiving this mail because: You are on the CC list for the bug.=