emacs-devel
[Top][All Lists]
Advanced

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

Re: [HELP] (bug?) Saving a buffer without any conversion?


From: Stefan Monnier
Subject: Re: [HELP] (bug?) Saving a buffer without any conversion?
Date: Tue, 14 Jan 2003 11:19:46 -0500

> > The effect I'm having is that we receive 1372422 bytes via the process
> > filter function STRING argument, and after insertion into a buffer,
> > we have a buffer with buffer-size 1372422, but after calling (save-buffer)
> > we get this:
> > 
> > -rw-r--r--    1 root     root      1865264 Jan 13 18:35 blah28.mp3
> > 
> > I'm using:
> > 
> >       (set-process-coding-system proc 'binary 'binary)
> >       (set-buffer-file-coding-system 'no-conversion t)
> 
> It seems that every byte in the range 0xa0 .. 0xff that were in the
> original file is prefixed with an 0x81 byte in the file containing the
> received data.  To me, that looks like the internal multi-byte
> representation for the binary data.

I think the mistake is to use a multibyte buffer.
A multibyte buffer stores a sequence of characters but what you
really want here is to store a sequence of bytes, which is what
a unibyte buffer does.
If you're careful, you can get things to work using a multibyte
buffer, but why bother when a unibyte buffer is simpler and
more efficient.


        Stefan





reply via email to

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