From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Boruch Baum Newsgroups: gmane.emacs.devel Subject: Re: fixing url-unhex-string for unicode/multi-byte charsets Date: Fri, 6 Nov 2020 07:28:46 -0500 Message-ID: <20201106122846.unoizvad53blgncf@E15-2016.optimum.net> References: <20201106074742.jq3h4uujm7oce7af@E15-2016.optimum.net> <83wnyy9akw.fsf@gnu.org> <20201106102756.e2ctvpjruenatud5@E15-2016.optimum.net> <83pn4q8zdz.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36546"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: NeoMutt/20180716 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Nov 06 13:32:20 2020 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 1kb0ui-0009PV-JA for ged-emacs-devel@m.gmane-mx.org; Fri, 06 Nov 2020 13:32:20 +0100 Original-Received: from localhost ([::1]:55286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kb0uh-0006Y2-Db for ged-emacs-devel@m.gmane-mx.org; Fri, 06 Nov 2020 07:32:19 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kb0rP-0005pn-Pd for emacs-devel@gnu.org; Fri, 06 Nov 2020 07:28:55 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:33291) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kb0rL-0004rD-V6; Fri, 06 Nov 2020 07:28:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1604665729; bh=Spxtz/ldEKq9jyAxTFnW39IfY8e0yanLJN0PRwobXJc=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=eOW4LipYHvUoNbFMQYPJgrIsCVj4hkCwjU+332vfV7ezDc9G/2HwG04YpuJQNHdsZ ztafquNGD4VADBIFxSnJFdS+YKEFC1odDF6BOBiSTK7eOZFEs/j4j0dM69r5t6pxHk fdV3iKiumZi9urp2lhSZKNk2mKpNyd0rOkErxeek= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from E15-2016.optimum.net ([70.19.86.82]) by mail.gmx.com (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MUXtS-1kjmJl06Pw-00QS3h; Fri, 06 Nov 2020 13:28:49 +0100 Content-Disposition: inline In-Reply-To: <83pn4q8zdz.fsf@gnu.org> X-Provags-ID: V03:K1:sJ4ESiY35CkTdDWnqvtow9sIvwqiSA+ohjBLQOZHo2D5+Ip1Y5O JIY0wL2cAp0WIH8Ww2DXDMrMQ9ZJ5NgSHNcWiUdlZ9945+dvew3db4ok49sdwImQlbdgZC6 LzGKsrOzENAFV3qZOgDBb2gusnbMK7BrEjnixiTg4eEZJ0TyJVhwUruaVE/3fx7qaouJmXe 97kQ2Yfnz9Bjq+d9Lz7sA== X-UI-Out-Filterresults: notjunk:1;V03:K0:r4y4hd4ooZk=:z93K43sjBnIOpRgXlc7tFX hhaTQ0mQbJDm4vdWVY76ut4bBnMI8nEfERhHI7AVzouhYfnFXC9WyV+CX70OpM1mF1fLuyuCk nQu+bo3F/O1HBzfI65UNABmvxMnnkmWZMX6R6K/QZ+aSonbGOHWHZsrBiVIC8dtZng9UIJT73 Jc3PIDEuG3T8FHYCiJmmg1bZ5l5HUfqid44yzk1v6OFchzW5M7KeVGAMQ28CgrowszjRyFSgE jKn20sIVk5TmN5qA7QoGFMJXrNuLV9wSpUPh00D1Ndto5ZvRVoVqi6Ggcqzqyh8bUNIVBZ9AB WjxCWenfBHFd7pTXXA2ag83X38Srod7DXVa4VlEIB5JA4c9q+7wbXxWXjDh0fFjx3lC40U4Xl LoMpdVJnDG69QPBUHViuQSkeAGLTm8v64g3HOKMP3RKWO+NptID1VVMksRRQ7isSo4r5swBfn p5o3wZrh9rKFqXbZDy+V9Vm9hvs2DVRtauk7+zTGMWKcqprpjq6KO8wSq9jn5CTBI53r7sVoF Of/Ip1Ypezvi3gW/ECr+YqemHwzLXUWA/k/JaIpnkldPMe1yAMBwm8IJ/66zVWqPan4B2CJnw D7FG5ZydLac3CsBBW5QHOb/bUop6n58ws1wKMn0ElFTofsfPOCzj7VH5U3XMS8PUuXFbf52tq pBctpTB/xjbQSyn+sfqPypAol8D07kuTzwTjwp4GpgkhNjvq6aUUkQanaErdaTf9ncmN9iV4X m7WcxKIdMlphp96lEJfwnOvPX/uSzVnoVPfP7iKQnv9VyLfKkAg3iyV61Ij0sqEUOQzEuwZN Received-SPF: pass client-ip=212.227.15.18; envelope-from=boruch_baum@gmx.com; helo=mout.gmx.net X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/06 04:34:54 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:258808 Archived-At: On 2020-11-06 14:04, Eli Zaretskii wrote: > > Date: Fri, 6 Nov 2020 05:27:56 -0500 > > From: Boruch Baum > > Cc: emacs-devel@gnu.org > I can't, not in full: I don't have a Freedesktop trash anywhere I have > access to. I did try the 2 file names you posted, including the one > with Hebrew characters, and it did work for me, on the assumption that > file-name-coding-system is UTF-8. > > > To reproduce, touch and then trash a file named some two Hebrew > > words delimited by a space. Navigate to the trash directory's 'info' > > sub-directory and extract the 'path' value from the file's meta-data > > .info file. That's the string we need to decode. Apply the string to > > your solution and see that you do not get the space-delimited two > > Hebrew words. > > A stand-alone test case, which doesn't require an actual trash, would > be appreciated, so I could see which parrt doesn't work, and how to > fix it. That would be the two file names that I previously posted. You say that they succeeded for you, but they didn't for me. The result I got was good for the first case (English two words), and garbage for the second case (Hebrew two words). > Alternatively, maybe you could explain why you needed to insert the > text into a temporary buffer and then extract it from there? AFAIK, > we have the same primitives that work on decoding strings as we have > for decoding buffer text. I don't need to. It's implementation done in emacs-w3m. I also pointed out that eww does it differently. I think the need in emacs-w3m is to mix the ascii characters and selected binary output, which can't be done with say replace-regexp-in-string. So what they do is use a temporary buffer, set `buffer-multibyte' to nil, and instead of replace-regexp-in-string build the result in the temporary buffer. =2D- hkp://keys.gnupg.net CA45 09B5 5351 7C11 A9D1 7286 0036 9E45 1595 8BC0