From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: How to get buffer byte length (not number of characters)? Date: Wed, 21 Aug 2024 20:47:54 +0300 Message-ID: <86y14pu5rp.fsf@gnu.org> References: <87wmkbekjp.fsf@ushin.org> <86o75nwilg.fsf@gnu.org> <87bk1lhkvg.fsf@ushin.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9101"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, schwab@suse.de, adam@alphapapa.net To: Joseph Turner Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Aug 21 19:48:50 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sgpRw-00029q-V2 for ged-emacs-devel@m.gmane-mx.org; Wed, 21 Aug 2024 19:48:49 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sgpRP-0002CK-UL; Wed, 21 Aug 2024 13:48:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgpRM-0002C1-3k for emacs-devel@gnu.org; Wed, 21 Aug 2024 13:48:12 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sgpRI-0008B5-UT; Wed, 21 Aug 2024 13:48:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=cC7w7sGTFC9sr4rGbeZ17s72oTSSXhaYMEr0KcEpvuw=; b=Gtx9m53n4Uyf KjgbOOwyGtMNEWaL3yNLoOtpz4CZnOc8pC4Ci0CZ3QzcRoPdCKb62aAxl/xcGLIilimGMPZhFSuYG bizLKp/+jq2yKnHZ7jQt7wBFrJWRXuDPl9tjpuy6N6qk4VSNeQm9mAi6t7+PXYxJ3iI+ib8onfXY9 ixzmLvtcIb7svZd74ayYt/P1AA690sWStDqnswmRqkS6tZWaiUPpV7dUVWk6AlqN40VndLN+orB2v 8H80KV1pPuYdCWPQYXwU5mKeNyUzJTGEAVIw5ygEGG/frU4qTDgQmm482aBc0o3CISGk48JZ7YDrG vLQvkN9Jvbuy0iMsuyje/Q==; In-Reply-To: <87bk1lhkvg.fsf@ushin.org> (message from Joseph Turner on Wed, 21 Aug 2024 02:20:09 -0700) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:323017 Archived-At: > From: Joseph Turner > Cc: emacs-devel@gnu.org, Andreas Schwab , Adam Porter > > Date: Wed, 21 Aug 2024 02:20:09 -0700 > > Let's say I create a textual hyperdrive file using hyperdrive.el, and > then I upload it by sending its contents via curl to the local HTTP > server. What coding system should be used when the file is uploaded? > > Let's say I have a `iso-latin-1'-encoded file "foo.txt" on my local > filesystem. I upload this encoded file to my hyperdrive by passing the > filename to curl, which uploads the bytes with no conversion. Then I > open the "foo.txt" hyperdrive file using hyperdrive.el, which receives > the contents via curl from the local HTTP server. In the hyperdrive > file buffer, buffer-file-coding-system should be `iso-latin-1' (right?). It's what I would expect, yes. But you can try it yourself, of course and make sure it is indeed what happens. > Then, I edit the buffer and save it to the hyperdrive again with > hyperdrive.el, which this time sends the modified contents over the wire > to curl. The uploaded file should be `iso-latin-1'-encoded (right?). Again, that'd be my expectation. But it's better to test this assumption. > Currently, plz.el always creates the curl subprocess like so: > > (make-process :coding 'binary ...) > > https://git.savannah.gnu.org/cgit/emacs/elpa.git/tree/plz.el?h=externals-release/plz#n519 > > Does this DTRT? It could be TRT if plz.el encodes the buffer text "by hand" before sending the results to curl and decodes it when it receives text from curl. Which I think is what happens there.