[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Extra character 194 appearing in network stream
From: |
Patrik Jonsson |
Subject: |
Re: Extra character 194 appearing in network stream |
Date: |
Sat, 17 Feb 2007 01:31:06 -0800 |
User-agent: |
Thunderbird 1.5.0.9 (Windows/20061207) |
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
signature.asc
Description: OpenPGP digital signature
- Extra character 194 appearing in network stream, Patrik Jonsson, 2007/02/16
- Re: Extra character 194 appearing in network stream, Jason Rumney, 2007/02/16
- Re: Extra character 194 appearing in network stream,
Patrik Jonsson <=
- Re: Extra character 194 appearing in network stream, Andreas Schwab, 2007/02/17
- Re: Extra character 194 appearing in network stream, Patrik Jonsson, 2007/02/17
- Re: Extra character 194 appearing in network stream, Andreas Schwab, 2007/02/17
- Re: Extra character 194 appearing in network stream, Patrik Jonsson, 2007/02/17
- Re: Extra character 194 appearing in network stream, Stefan Monnier, 2007/02/18