From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19019 invoked from network); 15 Mar 2023 15:32:28 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 15 Mar 2023 15:32:28 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1678894348; b=XkfPpzG880hywfnVkGpWf/caxCFGq8zKRdt2QHgjWwq6DTfZMft+nA34cAA5erD4vSoz1P0xjz xJ1ONnHDDJ8gL7IkWAUu8PofN8du7/9Q1Qe/+4oIGdax94SVwF+5WDidxzMHsLUcyzuWESvoDY yyyF+z1Lapk/WQ2YeI6KaYj+wh8xFz0iENQVtbk15xV3RDk8Rem+pV1C3vyDoUMNRQC5VzoW5C nL5aO7HplVdS++V//pUyrpPeWLlwPJ8D9GZRJvMiD+sGMLvXQ+nk3EUwwpKZ2mcB+YoUVDimS0 OC6FO3fri/X6h6EvrStvbkofSYhVuiRSrlkllaLP/z4AtQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f48.google.com) smtp.remote-ip=209.85.208.48; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1678894348; bh=a2YrNA5v/NPUIj9a0X5FY4efidL6T4wQwtAi05zZ4V0=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=nXurM1JyX1/VKkrKgN0Pq++MAI21M9hUu0u2Rkc+r8vBqk3bQVw8aX1JTZs08sRFY06Tt108lX 4HtTRBVR6AJiLvdqZFe/RKPq5ity9wcA3z0QGx9n4hM4Rek97TVpg29dxtYD1k5uRcSH9WZ+XW N2ji/tMWfdftPz0WNr/eb/IkZvEBSFOi8v2FBf/gpE975K+W/cMbXdP5r6NODUJ94XXCT3a2Ty pKCTmW9ic5FiHcsRnUzRCcV/kfAHguWSkCJgnO/DB3h3w45/dt5WE90ZzZZOVocrFlBBAJ8LsG Yk9Dpj84XMAd/mauXNmlzS1zYI1gvV2elWsWdDo/Chgf5g==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=Wd92pb9Yao3B8NoOHVi2CzBXdVLKo+2uGfWZMfPqrvA=; b=rUFlzuGPNrNqKcleIpx5I7VFRi 0zv2sVAM21ayfFei+ibXe6IzcDfxhkDPmIGHhqRg8TnoZWq/611I7p0iKz9q8XYyGL1xFGhAKBgL5 owQ4ZwNK6WtRYmuv3WJd+dzJLZyQ3zlrK/A3Z/6e/oR2h5iuHEpBR2uSEgm9M4ziTCgCTpvoIYkfh saMSDZ8EzCcDtBTmYlSWJ89kqHt0mrdC57e7IOSAwuSnWs5NjTXjkQuFa72fJakIDnCWCohwT77Wf Ze0lIuttSf41udHXxSZxmOK7AuqwJVUkq5x9esvP45rTYwbjtiPFplj1V/M8+f4dYbmo8A2Rp+XM9 9P87/WBw==; Received: by zero.zsh.org with local id 1pcT73-0005da-NP; Wed, 15 Mar 2023 15:32:25 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f48.google.com) smtp.remote-ip=209.85.208.48; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f48.google.com ([209.85.208.48]:39506) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1pcT6V-0005KZ-L2; Wed, 15 Mar 2023 15:31:52 +0000 Received: by mail-ed1-f48.google.com with SMTP id ek18so45968809edb.6 for ; Wed, 15 Mar 2023 08:31:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; t=1678894311; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Wd92pb9Yao3B8NoOHVi2CzBXdVLKo+2uGfWZMfPqrvA=; b=yT7Nkr9o+POjHUdiZgLDSgFs8AnHfbM7Zsl1SaGQE2qSE+THBktHeQMyKM44TSXKBs p6Qu3BlzX5jy3FB4pErvgvPZrGsirGxV2vtjw1q4lCklOrRRxFWWYenmny7Q2Pu07yHW EQowLkFG+0LGFLG2m/MBBbk0sz2vkJdDnoB+/lD/X/2DK+c18AWr9U5OShW8wBZaTC2O DzlQj22JezHGG9d04KDCEnjhUhVXFWEx+ZI9TvbhbA2Et2VuO6skVA7KO5hitQ2e8Rzg pG+xDPYWtNe8hFQOpuwTKOgEqjjRWkQnz0Eqtook6hOJeuQphqBdTfAlSmJkSgWfDZ3f XTJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678894311; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wd92pb9Yao3B8NoOHVi2CzBXdVLKo+2uGfWZMfPqrvA=; b=fjBnSfMLig1d/5PnNFz+ouIIFhHfuco97feJ5fWGkC4KyhBNqez4P5XK3IRbETBgKT 7dl2BH1MYlsVTtrW4G46tXlF2NY/9gUPcBxX8N3KeexVhBGYuG7AvS0EcrbiEwsBxMXp 74WLBzRsDlJTW/GJZj9ZXNsSRJrRXXm6Cep5arfIT9VqgvNpr1ccFSAGoN67u+66FTHd y9JlTUMF2faeUCm8dF5nfWzb+ocUNtUNg923VLnYONPKMCp8fX3NbFHbnzTbdDKsk0Rl 76GGXDKY16qIDWb8DxsbEYBkNp82K4O9RJ373DBD0DvBOuyic0NqKfJk/Gi57JyntXB+ X/Wg== X-Gm-Message-State: AO0yUKWDs5COnUeAMkrXkZSJrkXZEuh9AcUTFn7euqVJcdSp6rJBdU4R 8/Npq8NMBTWqEli6VTmv90GkDDETBHvKnpusQvEW3g== X-Google-Smtp-Source: AK7set/L+z8agWy9zQO1RO8jk2yPaAnI6Vs0UUZR0Advoudci0/m11mzefc0G3zwTqsWv7y9XueOCZRUdQEDXRQw7lo= X-Received: by 2002:a17:906:198c:b0:8b2:94c1:9e8f with SMTP id g12-20020a170906198c00b008b294c19e8fmr3433341ejd.12.1678894310974; Wed, 15 Mar 2023 08:31:50 -0700 (PDT) MIME-Version: 1.0 References: <1621619253.265114.1678847919086.ref@mail.yahoo.com> <1621619253.265114.1678847919086@mail.yahoo.com> <478761809.298180.1678856216911@mail.yahoo.com> In-Reply-To: <478761809.298180.1678856216911@mail.yahoo.com> From: Bart Schaefer Date: Wed, 15 Mar 2023 08:31:39 -0700 Message-ID: Subject: Re: bug report : printf %.1s outputting more than 1 character To: "Jason C. Kwan" Cc: "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 51579 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: , List-Subscribe: , List-Unsubscribe: , List-Post: List-Owner: List-Archive: On Tue, Mar 14, 2023 at 9:56=E2=80=AFPM Jason C. Kwan wrote: > > does the following ( below the "=3D=3D=3D=3D" line ) behavior look even r= easonable at all, regardless of your spec ? Because what the spec ends up d= oing is treating the rest of the input string as 1 byte and printing everyt= hing out, even though there are valid code points further down the input st= ring. I'm not the resident expert on multibyte character sets, so I'm just reporting the situation and waiting for e.g. PWS to respond. However, as far as my understanding of the multibyte library goes, once you've "desynchronized" the input by encountering an invalid byte, you're not guaranteed that anything further that you see can be correctly interpreted as a code point. I agree that it's not ideal to just dump everything else "raw".