From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Thu, 2 May 2013 16:43:21 +0200 From: tlaronde@polynum.com To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Message-ID: <20130502144321.GA438@polynum.com> References: <20130502123825.GA1975@polynum.com> <20130502132556.GA2653@polynum.com> <37e6edf11c49568bd52ff0f3a9bdbb71@brasstown.quanstro.net> Mime-Version: 1.0 In-Reply-To: <37e6edf11c49568bd52ff0f3a9bdbb71@brasstown.quanstro.net> User-Agent: Mutt/1.4.2.3i Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Subject: Re: [9fans] Octets regexp Topicbox-Message-UUID: 50aadbf2-ead8-11e9-9d60-3106f5b1d025 On Thu, May 02, 2013 at 09:44:38AM -0400, erik quanstrom wrote: > > This is a reflexion made to me by a developer who can use, when > > needed, regexp (ed(1) or sed(1)) on an Unix where they still deal > > with "char" (bytes) to search for a string of bytes in a binary. > > i have never needed to do this. could you provide some motiviation > for grepping for a wierd byte in an executable? surely the debugger > is better suited for this. > Because everything is not a program? But maybe data? For example, the TeX (or METAFONT etc.) predigested dumps are binary, but not program. > > And after some thought, I don't see an obvious reason why the regexp > > could not be used with bytes strings (so UTF-8 is OK) without trying to > > match runes (since not every bytes string is a correct UTF-8 sequence). > > because it makes things more complicated and probablly worse for the > common case, while not providing an new functionality already in > other tools. > Ah? I thought the purpose was to have not duplicated tools... And I'm not quite sure it would be more complicated for common cases since already defined functions could be wrappers calling more low level functions, with the definition of the size of the "entity"---byte, wyde, tetra, octa (when I'm at it: endianess too) or UTF-8. > > i think you've missed the point of making utf-8 *the* character set. > it's not sometimes the character set. or only on tuesday. it's always > the character set. > No: I have understood this. What I'm not totally sure about, is that the system deals with octet strings (as it have), and this UTF-8 i.e. Unicode is on the user interface, but is there a mean to not have the interface interpret the strings as UTF-8? Because everything is not text. -- Thierry Laronde http://www.kergis.com/ Key fingerprint = 0FF7 E906 FBAF FE95 FD89 250D 52B1 AE95 6006 F40C