From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Stefan Monnier" Newsgroups: gmane.emacs.devel Subject: Re: struct.el -- a package to encode/decode binary data Date: Thu, 21 Mar 2002 20:05:09 -0500 Sender: emacs-devel-admin@gnu.org Message-ID: <200203220105.g2M159I19881@rum.cs.yale.edu> References: <5x663qgcfp.fsf@kfs2.cua.dk> <200203211658.g2LGwYK17907@rum.cs.yale.edu> <2950-Thu21Mar2002214509+0200-eliz@is.elta.co.il> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1016759206 14409 127.0.0.1 (22 Mar 2002 01:06:46 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 22 Mar 2002 01:06:46 +0000 (UTC) Cc: monnier+gnu/emacs@rum.cs.yale.edu, storm@cua.dk, emacs-devel@gnu.org Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.33 #1 (Debian)) id 16oDW1-0003kI-00 for ; Fri, 22 Mar 2002 02:06:45 +0100 Original-Received: from fencepost.gnu.org ([199.232.76.164]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 16oDcS-0004VS-00 for ; Fri, 22 Mar 2002 02:13:25 +0100 Original-Received: from localhost ([127.0.0.1] helo=fencepost.gnu.org) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16oDVW-0007SE-00; Thu, 21 Mar 2002 20:06:14 -0500 Original-Received: from rum.cs.yale.edu ([128.36.229.169]) by fencepost.gnu.org with esmtp (Exim 3.34 #1 (Debian)) id 16oDUY-0007Oo-00 for ; Thu, 21 Mar 2002 20:05:15 -0500 Original-Received: (from monnier@localhost) by rum.cs.yale.edu (8.11.6/8.11.6) id g2M159I19881; Thu, 21 Mar 2002 20:05:09 -0500 X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 Original-To: "Eli Zaretskii" Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.5 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:2110 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:2110 > > From: "Stefan Monnier" > > Date: Thu, 21 Mar 2002 11:58:34 -0500 > > > > > > If the string holds non-ASCII text, yes. But not in your case, where the > > > > ``string'' holds binary data, I think. > > > > This is only true if binary values between 128 and 256 are represented > > as a single-byte, but that's not the case in multibyte strings. > > Most of them, those between 160 and 255 _are_ represented as a single > byte, even in a multibyte string/buffer. That's the eight-bit-graphic > character set. Interesting. It still means that binary values between 128 and 160 (i.e. from eight-bit-control) are posing problems when calling `aset'. But now that I think about it, if 160-255 can be an eight-bit-graphic character, how does the code does with "backward-char" ? Looking at DEC_POS in charset.h I see that we do while (p > p_min && !CHAR_HEAD_P (*p)) p--; so if the buffer is filled with eight-bit-graphic we might skip backward over the whole buffer before discovering that the char we want to skip was just an eight-bit-graphic. Do I understand the code correctly ? If so, shouldn't we set p_min to a value like max (p_min, p - MAX_MULTIBYTE_LENGTH) to make sure we don't hit this pathological case ? Stefan _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://mail.gnu.org/mailman/listinfo/emacs-devel