From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,MAILING_LIST_MULTI, URIBL_DBL_BLOCKED_OPENDNS,URIBL_ZEN_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=3.4.4 Received: from txout-a3-smtp.messagingengine.com (txout-a3-smtp.messagingengine.com [103.168.172.226]) by inbox.vuxu.org (Postfix) with ESMTP id 2D5B8235EB for ; Thu, 18 Dec 2025 21:20:42 +0100 (CET) Received: from localhost.localdomain (phl-topicbox-01.internal [10.202.2.219]) by mailtxout.phl.internal (Postfix) with ESMTP id EB49F1C01E3 for ; Thu, 18 Dec 2025 15:20:41 -0500 (EST) ARC-Authentication-Results: i=2; topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=TnjYUYRg header.a=rsa-sha256 header.s=20230601 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; spf=pass smtp.mailfrom=robpike@gmail.com smtp.helo=mail-pg1-f175.google.com; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type:list-help:list-id:list-post :list-subscribe:reply-to:content-transfer-encoding :list-unsubscribe; s=sysmsg-1; t=1766089241; bh=SFYf4ArBjw4xkRta Tpaq4ktX6o4Pw0nRUviX6M8lUUk=; b=k1xZSpEo6nW2Ww1MY2GKr3XOWB9XCFCl nhcHFN35KAMsWP4LaM82tkmUkGHi59kgOzeHOkeMD1MrgqTC8Vr4o+3Ek604Vh07 fjsKhM69Lpu8Gvsx2fjqwkIub9/csIDxKtYP489yfGPBqGiwT1BtXpNMYbVTZNSi PuJem8xPmbI= ARC-Seal: i=2; a=rsa-sha256; cv=pass; d=topicbox.com; s=sysmsg-1; t= 1766089241; b=RBvWokog7TLGTb3fJ1rU+9lzBjEn0Qv2sGqcZ3rNCgFHpTfnVV qlAgfel1urZ9/MZh8KiwEeFhvQ4YU8sY/zzguMwOdA8Q4LzH6/bSXf4DUKKdXP0O 0BOGsTXqgWSop6PgNwPVqv11MUStXWt2n2Is/zRq2hCPxI69Hmtfrp2WM= Authentication-Results: topicbox.com; arc=pass; dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=TnjYUYRg header.a=rsa-sha256 header.s=20230601 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; spf=pass smtp.mailfrom=robpike@gmail.com smtp.helo=mail-pg1-f175.google.com; x-internal-arc=fail (as.1.topicbox.com=pass, ams.1.topicbox.com=fail (message has been altered)) (Message modified while forwarding at Topicbox) X-Received-Authentication-Results: authmilter.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=TnjYUYRg header.a=rsa-sha256 header.s=20230601 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.215.175 (mail-pg1-f175.google.com); spf=pass smtp.mailfrom=robpike@gmail.com smtp.helo=mail-pg1-f175.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=mMeIlKwM; x-me-sender=none; x-ptr=pass smtp.helo=mail-pg1-f175.google.com policy.ptr=mail-pg1-f175.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt1.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com); x-tls=pass smtp.version=TLSv1.3 smtp.cipher=TLS_AES_128_GCM_SHA256 smtp.bits=128/128; x-vs=clean score=0 state=0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=9fans.net; h= mime-version:references:in-reply-to:from:date:message-id:subject :to:content-type:list-help:list-id:list-post:list-subscribe :reply-to:content-transfer-encoding:list-unsubscribe; s=dkim-1; t=1766089241; x=1766175641; bh=IldE65EzpZx6zTLKIMUnMx35HwvQvBKW +0y5XgQlUHg=; b=DI8i3L8GCJp1j4a+YcSWyNoPhEL4jKmpUA2BJU+WhwpDaxrk //l+/dsCRJd/ZtAZNR7c++X+4iyph0QRhB+juC9g54CclBFkh5KkPGWxM+JZ0ARD LeX+MONLFdeVfeGl7rE7CJ90NSZFkuJMoaO3ZFOs8et8+bUKvjpMj9PDJpE= Received: from authmilter.topicbox.com (unknown [172.17.0.1]) by mx.topicbox.com (Postfix) with ESMTP id D8BC54D80027 for <9fans@9fans.net>; Thu, 18 Dec 2025 15:16:18 -0500 (EST) Received: from mx.topicbox.com (172.17.0.1 [172.17.0.1]) by authmilter.topicbox.com (Authentication Milter) with ESMTP id A224C810EF8; Thu, 18 Dec 2025 15:16:18 -0500 ARC-Seal: i=1; a=rsa-sha256; cv=none; d=topicbox.com; s=arcseal; t= 1766088978; b=xxAsxcw7DCt85KUuwlGeKwVYVphFKBet3Vml1AAyOdC5INueFZ SIRMMsXjmhSQ4LY67sopmDaLEAf3iwZbWot0oGrxO1dvzPRmIwA4O/uSosO7fIMS 7LJlY+OiAwbZQ9MzCKRGp5TYIq1+RiYyYNZGEdhehq1r/u4dqlzALr12Cojj6f1R /V2lilynesTgnGkxuEGgN3k9F+Pp7hD+kW6GdbHh1bgGu1UjfYfWpY66ymQeTTAP ruKZqZXM3W450AHsOXD0mXut7YlA0gRd23uzeRvT6w5/DoZrQulJji+mwL95rEYi DM6RThS8nlHbECd2p9Ol40VHuwd9hxYGXCyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d= topicbox.com; h=mime-version:references:in-reply-to:from:date :message-id:subject:to:content-type; s=arcseal; t=1766088978; bh=M0V05z5Ug95N0TRIqdPI9cTKTlO6zFU+Y+RgiSJlb5Q=; b=hJBzABLN7uuo EQ3Kv71YjAxWEHZYEiNvyXEzWCR/bCGmorGka5PvSKGzFBJsm+TRzfY1FH2nAbjC U0St8F0I08EUb4kfK7r90jv7Qr0IEHOhIV27fn4VvvJMFeq62wTn4Cf+zn8m7jX5 c4qSM9B/nKZcmZa7reyU6rrz+yOEWQCbYIU092Veu5ff8/uJN5xwpNeZlTxsmiIP j+Qjxfoh3uSO3+YODf3SraEsGToRLTxDnRekxfhjR/g1Q72062DyX1Ga0x0veT/g fAl3TiOesrxUqPgLlZ0v/zREE67XrPRHxmbYDx2Vwnh80QAK1FNzyJbJmh4RJHS+ CciTXwrTCA== ARC-Authentication-Results: i=1; authmilter.topicbox.com; arc=none (no signatures found); bimi=skipped (DMARC Policy is not at enforcement); dkim=pass (2048-bit rsa key sha256) header.d=gmail.com header.i=@gmail.com header.b=TnjYUYRg header.a=rsa-sha256 header.s=20230601 x-bits=2048; dmarc=pass policy.published-domain-policy=none policy.published-subdomain-policy=quarantine policy.applied-disposition=none policy.evaluated-disposition=none (p=none,sp=quarantine,d=none,d.eval=none) policy.policy-from=p header.from=gmail.com; iprev=pass smtp.remote-ip=209.85.215.175 (mail-pg1-f175.google.com); spf=pass smtp.mailfrom=robpike@gmail.com smtp.helo=mail-pg1-f175.google.com; x-aligned-from=pass (Address match); x-google-dkim=pass (2048-bit rsa key) header.d=1e100.net header.i=@1e100.net header.b=mMeIlKwM; x-me-sender=none; x-ptr=pass smtp.helo=mail-pg1-f175.google.com policy.ptr=mail-pg1-f175.google.com; x-return-mx=pass header.domain=gmail.com policy.is_org=yes (MX Records found: alt1.gmail-smtp-in.l.google.com,alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com); x-return-mx=pass smtp.domain=gmail.com policy.is_org=yes (MX Records found: alt3.gmail-smtp-in.l.google.com,alt4.gmail-smtp-in.l.google.com,alt1.gmail-smtp-in.l.google.com,alt2.gmail-smtp-in.l.google.com,gmail-smtp-in.l.google.com); x-tls=pass smtp.version=TLSv1.3 smtp.cipher=TLS_AES_128_GCM_SHA256 smtp.bits=128/128; x-vs=clean score=0 state=0 X-ME-VSCause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdegieefiecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecunecujfgurhepgghfjg fhfffkuffvtgesrgdtreertddtjeenucfhrhhomheptfhosgcurfhikhgvuceorhhosghp ihhkvgesghhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhepiedtgfekudehtddvke efieethfejlefgtdeltdeigfehveehfeeuleeuteekhfdvnecukfhppedvtdelrdekhedr vdduhedrudejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpe dvtdelrdekhedrvdduhedrudejhedphhgvlhhopehmrghilhdqphhguddqfhdujeehrdhg ohhoghhlvgdrtghomhdpmhgrihhlfhhrohhmpeeorhhosghpihhkvgesghhmrghilhdrtg homheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepoeelfhgrnhhsseelfhgrnhhs rdhnvghtqe X-ME-VSScore: 0 X-ME-VSCategory: clean Received-SPF: pass (gmail.com ... _spf.google.com: Sender is authorized to use 'robpike@gmail.com' in 'mfrom' identity (mechanism 'include:_netblocks.google.com' matched)) receiver=authmilter.topicbox.com; identity=mailfrom; envelope-from="robpike@gmail.com"; helo=mail-pg1-f175.google.com; client-ip=209.85.215.175 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx.topicbox.com (Postfix) with ESMTPS for <9fans@9fans.net>; Thu, 18 Dec 2025 15:16:18 -0500 (EST) Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-c03eb31db80so809840a12.2 for <9fans@9fans.net>; Thu, 18 Dec 2025 12:16:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766088977; x=1766693777; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=M0V05z5Ug95N0TRIqdPI9cTKTlO6zFU+Y+RgiSJlb5Q=; b=mMeIlKwM6GZdNqgvOy18SNluEu1PLuP8EZRc9YhWynjxypoGSsbLBmsUV1BofXQ3xX 0Eb16pdnkj5Rgy2yaJdeD81JeH7ybd+pMOsqQjPCFl5JJsTKOtaTiK7flihUS3BXKnav RCR1NLwoWoLnWxEQMsE+VdqfiB+pl3K/9lAMcaAPQbKNjwMUA6iuxmEwxlfh8qSoDcdE F6KKO/cfKldjNsJay556XugHndWimi/2SEBfoUl2r56qyJ9BTOwSduY46gN1pTHfdcSO eyrrIdzN8XQeN76cqHU7ePZUoiU42N1ibd82tWODaFK4WZiT2gnYaJ1CIweegdzNi+Ga OjRQ== X-Gm-Message-State: AOJu0YxNqY7lhV4rdvjSmsMIfQ67MWjmOTdsswzLkeDSkaS++4BQch/g p1YdmnsJ3xybrfMdoGGEoEOpksYILPq52FtNIeStpRZwm7XDmX4ZiCZe0A+BdUAZulzR6hMCcgJ rDW43oxZj8Sd8HQbZg+I6uYdH88SYSHJeBCmd X-Gm-Gg: AY/fxX5qM+BPrb7Z0ooYfuEqMx6D4Svig94RZWKoCiubYVhyU/F7so88izKds1OGdt8 2vhY/d0aFyo+uhS8JDBp7PiRVepofY80SHpbcx90/9xszulXyLvqot+xmbQLwF7V9cyv/SC23+N NTHssOAR+LJMQyg4H+Y50ldL3GzutsZLvr24JRY6eddSD5Ba9AsHF0kbJ5K8bvTuyqIh1hMaxr3 rAglQtpBxJdV+/lgvLdqFnJtV8nEFHhEL9tCQMhgI6DWLdsIgrJJrC0kVhLQjaaXNN2Qv//P2lO +q8KvKUJtDcgbk8AEucOZeEEBj8= X-Google-Smtp-Source: AGHT+IHRkK79WJDQw+liZduBPlZwo3/7qQglDz96/haxyvJXd1WmvOJIXY8b1E7wZVZi6PGt4yHzFTE9bKpHRrkJVQk= X-Received: by 2002:a05:7301:1983:b0:2ab:9b40:fc78 with SMTP id 5a478bee46e88-2b05ec3dcefmr799186eec.20.1766088977393; Thu, 18 Dec 2025 12:16:17 -0800 (PST) MIME-Version: 1.0 References: <2ae07915-6e27-49f6-9424-d3eacc73e9e7@posixcafe.org> In-Reply-To: From: Rob Pike Date: Fri, 19 Dec 2025 07:16:05 +1100 X-Gm-Features: AQt7F2rjyBzYsFKhTFU34-EWeOkWdw4w5GTEEeupdDe-b4qTPuPU7M1kbeQjUxc Message-ID: Subject: Re: [9fans] Why does utfutf() exist? To: 9fans <9fans@9fans.net> Content-Type: multipart/alternative; boundary=00000000000023aded06463fa2ef Topicbox-Policy-Reasoning: moderate: sender is a member; group holds all messages Topicbox-Message-UUID: 6a52f5da-dc4e-11f0-afc0-f47b6bc11ef0 Archived-At: =?UTF-8?B?PGh0dHBzOi8vOWZhbnMudG9waWNib3guY29tL2dyb3Vwcy85?= =?UTF-8?B?ZmFucy9UODgzMTA3M2Y4YjhiYjM1MS1NYzBhOGYzZTMwMjc5YTAwOTljMjlj?= =?UTF-8?B?OGUzPg==?= List-Help: List-Id: "9fans" <9fans.9fans.net> List-Post: List-Software: Topicbox v0 List-Subscribe: Precedence: list Reply-To: 9fans <9fans@9fans.net> Content-Transfer-Encoding: 7bit List-Unsubscribe: , Topicbox-Delivery-ID: 2:9fans:437d30aa-c441-11e9-8a57-d036212d11b0:522be890-2105-11eb-b15e-8d699134e1fa:Mc0a8f3e30279a0099c29c8e3:1:2o36f3lojPspsE8WFIcElu-V99FbVYEiOCdynJYmBHo --00000000000023aded06463fa2ef Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable It was written for UTF (sic), not UTF-8, which was non-synchronizable and therefore ambiguous so care needed to be taken when looking for byte sequences. It stayed around after that. It may not be necessary, although without checking I can't say whether it behaves the same as strstr when illegal UTF-8 encodings occur. -rob ------------------------------------------ 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/T8831073f8b8bb351-Mc0a8f= 3e30279a0099c29c8e3 Delivery options: https://9fans.topicbox.com/groups/9fans/subscription --00000000000023aded06463fa2ef Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
It was written for UTF (sic), not UTF-8, which was no= n-synchronizable and therefore ambiguous so care needed to be taken when lo= oking for byte sequences. It stayed around after that. It may not be necess= ary, although without checking I can't say whether it behaves the same = as strstr when illegal UTF-8 encodings occur.

-rob


= --00000000000023aded06463fa2ef--