all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Patrik Jonsson <patrik@ucolick.org>
To: Jason Rumney <jasonr@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Extra character 194 appearing in network stream
Date: Sat, 17 Feb 2007 01:31:06 -0800	[thread overview]
Message-ID: <45D6CB5A.5020402@ucolick.org> (raw)
In-Reply-To: <45D67B16.7010804@gnu.org>


[-- Attachment #1.1: Type: text/plain, Size: 1198 bytes --]

Jason Rumney wrote:
>
>> I'm sure there are experts here that can tell me why this might be
>> happening, because at this point I'm stumped. I'm positive this was not
>> a problem in emacs 20, but it now happens very frequently in 23.0.
>>   
>
> What is more interesting to us right now is whether Emacs 22 works, as
> we are close to releasing that.
I tracked the problem down to the piece of code that packed a number
into a network-order 4-byte string:

      (format "%c%c%c%c"
        (lsh (logand i 4278190080) -24)
        (lsh (logand i 16711680) -16)
        (lsh (logand i 65280) -8)
        (logand i 255))

which when (logand i 255) >127 apparently produces a 5-character string.
I tried it on both 22.0.92.1 and 23.0.0.1 (i386-mingw-nt5.1.2600) with
identical results. It seems emacs has abandoned the notion that a
character is a byte, but one would at least think a character <256
should be one byte? Interestingly it never seems to make 2-byte
characters with just a single "%c" in the format, it needs at least one
preceding character to happen.

In any case I solved the problem by replacing this with the bindat
functions.

Regards,

/Patrik



[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

[-- Attachment #2: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

  reply	other threads:[~2007-02-17  9:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-17  0:53 Extra character 194 appearing in network stream Patrik Jonsson
2007-02-17  3:48 ` Jason Rumney
2007-02-17  9:31   ` Patrik Jonsson [this message]
2007-02-17  9:47     ` Andreas Schwab
2007-02-17  9:53       ` Patrik Jonsson
2007-02-17 10:03         ` Andreas Schwab
2007-02-17 18:53           ` Patrik Jonsson
2007-02-18 18:47             ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45D6CB5A.5020402@ucolick.org \
    --to=patrik@ucolick.org \
    --cc=emacs-devel@gnu.org \
    --cc=jasonr@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.