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: dired-do-find-regexp failure with latin-1 encoding Date: Sun, 29 Nov 2020 17:19:59 +0200 Message-ID: <83360smbq8.fsf@gnu.org> References: <87blfhjr4q.fsf@gmx.net> <83k0u5mjvf.fsf@gnu.org> <877dq5jp51.fsf@gmx.net> <83im9pmh0v.fsf@gnu.org> <106736d6-1732-3f24-15c5-af7bcfd688c6@yandex.ru> <83blfhmdho.fsf@gnu.org> <247a8edb-7b70-ad32-1ba1-43b5458a82b0@yandex.ru> <42ba5cae-e0d7-afd1-9974-62e7ee5840c6@yandex.ru> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21078"; mail-complaints-to="usenet@ciao.gmane.io" Cc: stephen.berman@gmx.net, emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 29 16:20:41 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 1kjOVF-0005Nj-5w for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Nov 2020 16:20:41 +0100 Original-Received: from localhost ([::1]:47110 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjOVE-0007gy-47 for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Nov 2020 10:20:40 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55702) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjOUk-0007Hu-4k for emacs-devel@gnu.org; Sun, 29 Nov 2020 10:20:10 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:35281) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjOUj-0004g3-8v; Sun, 29 Nov 2020 10:20:09 -0500 Original-Received: from [176.228.60.248] (port=2228 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kjOUi-0005LI-OS; Sun, 29 Nov 2020 10:20:09 -0500 In-Reply-To: <42ba5cae-e0d7-afd1-9974-62e7ee5840c6@yandex.ru> (message from Dmitry Gutov on Sun, 29 Nov 2020 02:49:25 +0200) 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:260008 Archived-At: > From: Dmitry Gutov > Cc: stephen.berman@gmx.net, emacs-devel@gnu.org > Date: Sun, 29 Nov 2020 02:49:25 +0200 > > On 28.11.2020 23:04, Dmitry Gutov wrote: > > or latin-1 (AND the current system locale matches that encoding), the > > search should work fine across such files in different encodings, and > > without 'C-x RET c' > > Correction: only utf-8 and utf-16 detection is automatic. latin-1 needs > explicit arguments '-E latin-1' passed to rg. > > The official recommended workaround is to use a --pre flag which is > similar to what Stephen did originally by inserting 'iconv ...' in the > shell command string: https://github.com/BurntSushi/ripgrep/issues/746 How can --pre help? It still cannot easily support different encodings in the same command, right? > I suppose if we really wanted, we could insert some custom program that > chooses what to 'iconv' with, but that would be slower, of course. But > it could work with Grep, too. It would be brittle, unless that program actually reads the entire file (which will be slow).