[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: struct.el -- a package to encode/decode binary data

From: Kenichi Handa
Subject: Re: struct.el -- a package to encode/decode binary data
Date: Fri, 22 Mar 2002 10:25:39 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.1.30 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

"Stefan Monnier" <monnier+gnu/address@hidden> writes:
> 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--;

Please don't skip the following four lines:

        len = pend + 1 - p;                                             \
        PARSE_MULTIBYTE_SEQ (p, len, bytes);                            \
        if (bytes == len)                                               \
          pos_byte -= len - 1;                                          \

which handles the above case.  When we at last reach a
char-head, PARSE_MULTIBYTE_SEQ checks how long the byte
sequence should be.  We update pos_byte only if the length
is the same as what we decreased.

Ken'ichi HANDA

reply via email to

[Prev in Thread] Current Thread [Next in Thread]