emacs-devel
[Top][All Lists]
Advanced

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

Re: suggestion: function: buffer-bytes


From: David Kastrup
Subject: Re: suggestion: function: buffer-bytes
Date: Sun, 01 Jul 2007 08:31:05 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

"T. V. Raman" <address@hidden> writes:

> Stephane,
>
> Where I used this:
>
> Package g-client 
> http://emacspeak.googlecode.com/svn/trunk/lisp/g-client 
>
> I use curl to talk HTTP in that package -- uses Atom Publishing
> Protocol to talk to servers --
> and I needed the byte count  for computing HTTP headers
> correctly.
> It does appear to work, but also because I do set buffer-encoding
> appropriately in those buffers where I am building up the HTTP
> message being posted.

You can't: buffers are always encoded in Emacs-mule (or its own
version of utf-8 in Emacs 23), or in unibyte (in which case the
position-byte function becomes rather pointless).  I don't know what
you call "set buffer-encoding appropriately".

You can. presumably, talk in unibyte with your server and do the
encoding and decoding on the way to the buffer manually.  In which
case you can just use buffer positions in characters as synonyms with
those in bytes.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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