From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: suggestion: function: buffer-bytes Date: Sun, 01 Jul 2007 08:31:05 +0200 Message-ID: <85ir941vpy.fsf@lola.goethe.zz> References: <18054.62174.507770.924924@gargle.gargle.HOWL> <18055.5127.154758.705881@gargle.gargle.HOWL> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1183271480 6448 80.91.229.12 (1 Jul 2007 06:31:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 1 Jul 2007 06:31:20 +0000 (UTC) Cc: monnier@iro.umontreal.ca, emacs-devel@gnu.org To: raman@users.sf.net Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 01 08:31:18 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I4sxp-0006SJ-V7 for ged-emacs-devel@m.gmane.org; Sun, 01 Jul 2007 08:31:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I4sxn-0006BY-3v for ged-emacs-devel@m.gmane.org; Sun, 01 Jul 2007 02:31:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I4sxk-0006BR-3n for emacs-devel@gnu.org; Sun, 01 Jul 2007 02:31:12 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I4sxi-0006BF-IB for emacs-devel@gnu.org; Sun, 01 Jul 2007 02:31:11 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I4sxi-0006BC-El for emacs-devel@gnu.org; Sun, 01 Jul 2007 02:31:10 -0400 Original-Received: from mail-in-10.arcor-online.net ([151.189.21.50]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I4sxh-0002o3-TN for emacs-devel@gnu.org; Sun, 01 Jul 2007 02:31:10 -0400 Original-Received: from mail-in-08-z2.arcor-online.net (mail-in-08-z2.arcor-online.net [151.189.8.20]) by mail-in-10.arcor-online.net (Postfix) with ESMTP id 5997A1F5A97; Sun, 1 Jul 2007 08:31:08 +0200 (CEST) Original-Received: from mail-in-08.arcor-online.net (mail-in-08.arcor-online.net [151.189.21.48]) by mail-in-08-z2.arcor-online.net (Postfix) with ESMTP id 48046212FB6; Sun, 1 Jul 2007 08:31:08 +0200 (CEST) Original-Received: from lola.goethe.zz (dslb-084-056-152-162.pools.arcor-ip.net [84.56.152.162]) by mail-in-08.arcor-online.net (Postfix) with ESMTP id 0652D2BAED9; Sun, 1 Jul 2007 08:31:07 +0200 (CEST) Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id D7EB21D03440; Sun, 1 Jul 2007 08:31:06 +0200 (CEST) In-Reply-To: <18055.5127.154758.705881@gargle.gargle.HOWL> (T. V. Raman's message of "Sat\, 30 Jun 2007 19\:40\:07 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Virus-Scanned: ClamAV 0.90.3/3565/Sun Jul 1 05:55:13 2007 on mail-in-08.arcor-online.net X-Virus-Status: Clean X-detected-kernel: Linux 2.4-2.6 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:74089 Archived-At: "T. V. Raman" 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