From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5572B385C335; Tue, 30 Aug 2022 11:33:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5572B385C335 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1661859194; bh=edbOvivP3E3+wBhsGNSwHtA87lMgKlMArE27HpzomNs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Ubzm1n5rgDJgFL928bm6jE9UbQqZTTp2yNOEYIHdKl57mVDT9eXNcJc1sSQsRwD0D fviwGr9SRZ+mAOiYvsSczsfhJ8O079kOa7Yh9W9qgy/b/uQqBZleHJUFBVnIExqNHt zkRhFHFPhpaHoslFsiEGbdWg9Asutde8vwbMzJqI= From: "nabijaczleweli at nabijaczleweli dot xyz" To: glibc-bugs@sourceware.org Subject: [Bug locale/29511] default/C/POSIX locale is 7-bit (127 characters), must be 8-bit (256 characters) since POSIX Issue 7 TC2/Issue 8 Date: Tue, 30 Aug 2022 11:33:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: locale X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: nabijaczleweli at nabijaczleweli dot xyz X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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=3D29511 --- Comment #2 from =D0=BD=D0=B0=D0=B1 --- I don't see how that's relevant? The POSIX locale is /not/ US-ASCII: it's /some/ encoding that contains the PCS and NPCS as the first 128 characters (this coincides with 7-bit ASCII) /and/ contains mappings from all 256 sing= le bytes to a character (and back). This is very obviously listed in the first hunk, which I'll reiterate again: POSIX.1, Issue 7 TC 2, XBD, 6.2 "Character Encoding" starts with: > The POSIX locale shall contain 256 single-byte characters including the characters in Portable Character Set and Non-Portable Control Characters, w= hich have the properties listed in LC_CTYPE.=20 The bug here isn't "glibc doesn't decode ASCII [0xfa, 0] to my favourite character", it's "glibc treats POSIX locale as-if it were ASCII" =E2=80=93 = which it's not. >From your response it appears you also haven't consulted bug 663 (an oversi= ght on my part, it seems I only linked it directly in the Debian bug, and here indirectly): https://www.austingroupbugs.net/view.php?id=3D663 =E2=80=93 it= contains a summary of changes that make the Issue 7 TC 2/Issue 8 POSIX locale as-described. POSIX.1, Issue 7 TC 2, XSH, mbrtowc(), ERRORS: -- >8 -- [EILSEQ] An invalid character sequence is detected. [CX]In the POSIX locale an EILSEQ error cannot occur since all byte values are valid characters.[/CX] -- >8 -- (the same text is seen in mbrlen(), mbstowcs(), &c., &c.). POSIX.1, Issue 7 TC 2, XRAT, XBD, A.6.2 Character Encoding: -- >8 -- Earlier versions of this standard did not state the requirement that the PO= SIX locale contains 256 single-byte characters. This was an oversight; the intention was always that the POSIX locale should have an 8-bit-clean single-byte encoding. -- >8 -- I hope this convinces you that this is not RESOLVED INVALID, but, indeed, a conformance error. A different, less messy than the one in my patch (or just making it a KOI-8 variant, which is admittedly the worst one so far), solution I arrived at t= oday would be to map [0, 0x7F] to [U+0, U+7F] as is done currently and B[0x80, 0= xFF] to C[U+FFFFFF80, U+FFFFFFFF] or C[U+FFFFFF00, U+FFFFFF7F] =E2=80=94 I don't= think Unicode will reach that high any-time soon =E2=80=93 or to pick a PUA and m= ap to C[U+100000, U+10007F]/C[U+E080, U+E0FF]/you get the point here =E2=80=93 "u= sing glibc" reasonably fits as a "private agreement between collaborating users". Changing the CODESET is also, presumably, a given: naively, to "POSIX", I guess? --=20 You are receiving this mail because: You are on the CC list for the bug.=