From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#54154: 29.0.50; [PATCH] `sieve-manage-getscript' fails if script contains multibyte characters Date: Fri, 25 Feb 2022 13:19:51 +0100 Message-ID: <878rtzxhnc.fsf@gnus.org> References: <87wnhj5nbk.fsf@tetzco.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4137"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 54154@debbugs.gnu.org To: "Kai Tetzlaff" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 25 13:25:35 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1nNZfC-0000nS-Uo for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Feb 2022 13:25:34 +0100 Original-Received: from localhost ([::1]:36316 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNZfC-0005Aq-0q for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 25 Feb 2022 07:25:34 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNZao-0001TN-Bx for bug-gnu-emacs@gnu.org; Fri, 25 Feb 2022 07:21:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57591) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nNZao-0006Rp-0q for bug-gnu-emacs@gnu.org; Fri, 25 Feb 2022 07:21:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nNZan-0002Mm-Rq for bug-gnu-emacs@gnu.org; Fri, 25 Feb 2022 07:21:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 25 Feb 2022 12:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54154 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 54154-submit@debbugs.gnu.org id=B54154.16457916099002 (code B ref 54154); Fri, 25 Feb 2022 12:21:01 +0000 Original-Received: (at 54154) by debbugs.gnu.org; 25 Feb 2022 12:20:09 +0000 Original-Received: from localhost ([127.0.0.1]:51488 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNZZw-0002L8-Dy for submit@debbugs.gnu.org; Fri, 25 Feb 2022 07:20:08 -0500 Original-Received: from quimby.gnus.org ([95.216.78.240]:57796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nNZZq-0002KS-F6 for 54154@debbugs.gnu.org; Fri, 25 Feb 2022 07:20:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=sFFuLKAnldBhuLGOgN5GT5SW0WnftzEVR5vYyOAZqWo=; b=nJ0/bdPIvPdjh4MD0S6x5NTJ/5 LX9uEGzvXz1Kn1E6GJ8M28Jhme9OcIZf9ihQSFI4FHAvJvT0KIviOTaG4RTqq7/tBSbCnSEhg0Aml g5/4zPPVOh0zo+wqoBKrHk2E5I+DfmT4VsZl7c1PtKQwxVLBOs4FGKJeCWe2q/ONfarI=; Original-Received: from [84.212.220.105] (helo=giant) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nNZZf-0001QT-Rb; Fri, 25 Feb 2022 13:19:56 +0100 X-Now-Playing: Patrik Torsson's =?UTF-8?Q?=5FKolv=C3=A4teserenader=5F:?= "=?UTF-8?Q?Avm=C3=B6nstring?=" In-Reply-To: <87wnhj5nbk.fsf@tetzco.de> (Kai Tetzlaff's message of "Fri, 25 Feb 2022 10:04:47 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:227627 Archived-At: "Kai Tetzlaff" writes: > (with-current-buffer (or buffer (current-buffer)) > (sieve-manage-send (format "GETSCRIPT \"%s\"" name)) > + (set-buffer-multibyte nil) > (let ((script (sieve-manage-parse-string))) > + (set-buffer-multibyte t) Changing multibyteness in a buffer like this is (virtually) never the right thing to do -- it usually leads to obscure breakages. > In general, it is also not clear to me why the response (or process) > buffer needs to be multibyte enabled at all as it should only be used > for the line/byte oriented protocol data. But the commit message of > 8e16fb987df9b which introduced the multibyte handling states: > > commit 8e16fb987df9b80b8328e9dbf80351a5f9d85bbb > Author: Albert Krewinkel > Date: 2013-06-11 07:32:25 +0000 > ... > * Enable Multibyte for SieveManage buffers: The parser won't properly > handle umlauts and line endings unless multibyte is turned on in the > process buffer. > ... > > so this was obviously done on purpose. I contacted Albert about this but > he couldn't remember the details (it's been nearly 10 years). I don't see why this buffer should be multibyte, either. The communication with the server is done using bytes, not characters. When we need to have characters, we should decode the data and put it in a multibyte buffer. So can you try to back out that commit and see whether it fixes the problem instead? -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no