From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: dired-do-find-regexp failure with latin-1 encoding Date: Sun, 29 Nov 2020 19:19:43 +0200 Message-ID: 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> <838sakmccw.fsf@gnu.org> <83o8jgkrxo.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2918"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: stephen.berman@gmx.net, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 29 18:20:46 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 1kjQNS-0000fa-22 for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Nov 2020 18:20:46 +0100 Original-Received: from localhost ([::1]:55660 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kjQNR-0003e2-4D for ged-emacs-devel@m.gmane-mx.org; Sun, 29 Nov 2020 12:20:45 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kjQMY-00033R-BH for emacs-devel@gnu.org; Sun, 29 Nov 2020 12:19:50 -0500 Original-Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:43205) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kjQMW-0005iy-Hx; Sun, 29 Nov 2020 12:19:50 -0500 Original-Received: by mail-wr1-x436.google.com with SMTP id s8so11963379wrw.10; Sun, 29 Nov 2020 09:19:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=A0xR8sxccuIGN0GyKyj4zhk2xOcgUStDxN2PjHXB1T0=; b=AB3ttQ/ra6eriVZ2Gv5wIUx03WRRu2Ui4KIDOzU/Qk4QtLNrnHkFHsq9bWzsIWy1vk ZRc+rW6tBX0JfPu9DfYK6DO58/CPNF4+6/SY8boRZB9lKCeZ2UtJ1wgYqyRSNrUm0jCR wKEseBVKpnntT0w8dwBGcgetBOIiuOb1lsAw/YesL9JSt4b6vfREr2wZ9N38XpU33mYU Ox3jGOMvawgaxuZV5oV8yKcCA4RKOCfJ/JqXCg99tZ3vPB86DBCoxtua9m6oqNCaDEYZ FRNo2qM++JDExoHpSokw4LEHl/GBj6T08X0nkSQU+0tpTlg3zLS9ey6Y4KBWfBdnoW6Z Zf4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=A0xR8sxccuIGN0GyKyj4zhk2xOcgUStDxN2PjHXB1T0=; b=AJJ0UHupPoalcL+UuFYQNsQZCXkrab+jFkrMMREyyz+NjqgrnzucYT01Q7wijr5Q9K h0ruBZDIk5A3VDJbdPXN46IZ8JI4RyC7W+nmnX19JGU0wWVy4vsUmhp9GmaUX24XL1mv m+QCGvdqzncKXV7WzrXzhswzfde4Mcif+iV95S7icxnQH3+Y5C/oURH51X7UVgashdTZ /8C4jmBLPiEjxhlIvrdOgRvYCB/SvWCH6mBXS5WWMjPdNamIYXVkI/ORMQBQi/IK/9MJ un6/7AZdkrFz+V65xRhJFJeZAKdG4++RSbNrHhDhUaGEioNbVYaJwq8KR3nyhm9UpoSv aeHg== X-Gm-Message-State: AOAM530ChmYaJ9ktQCYZTGdYckK4Fw80LUZTnnRF9EYF6W0jHpRPcYt8 gy/HEUxHnmhFXoli4wPaW0O9VkHYG01hvQ== X-Google-Smtp-Source: ABdhPJzBGnrYALDfSU0l1KtS0svgt1CQ//QTLNj7I6s3IsINE6RiFBYfqmcC0Dy3Fi2hM2YWr+kyLA== X-Received: by 2002:adf:f882:: with SMTP id u2mr23596780wrp.271.1606670386317; Sun, 29 Nov 2020 09:19:46 -0800 (PST) Original-Received: from [192.168.0.4] ([66.205.71.3]) by smtp.googlemail.com with ESMTPSA id y2sm24992604wrn.31.2020.11.29.09.19.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 Nov 2020 09:19:45 -0800 (PST) In-Reply-To: <83o8jgkrxo.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=raaahh@gmail.com; helo=mail-wr1-x436.google.com X-Spam_score_int: -4 X-Spam_score: -0.5 X-Spam_bar: / X-Spam_report: (-0.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.248, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=1, HEADER_FROM_DIFFERENT_DOMAINS=0.248, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:260016 Archived-At: On 29.11.2020 19:12, Eli Zaretskii wrote: >> Cc: stephen.berman@gmx.net, emacs-devel@gnu.org >> From: Dmitry Gutov >> Date: Sun, 29 Nov 2020 18:07:38 +0200 >> >> Adding -a or prepending 'LC_ALL=C' changes that: >> $ LC_ALL=C grep "prem" latin1.txt >> premi�re is first >> premie?re is slightly different > > Is that � what Grep actually produced? That's copied from a terminal emulator. If I run it with shell-command, I get this: premi\350re is first premie?re is slightly different (\350 being a raw char) >>> What is not clear to me is whether the _output_ is always in some >>> fixed encoding, like UTF-8. That doesn't seem to be stated in the >>> docs there. >> >> Judging by a small experiment, rg's output is in the same encoding as >> input, for each file. > > So in this aspect it is not better than Grep: it is still impractical > to search through files that have different encodings. It's not optimal, but the important thing is to get matches from all of them. Even if some can be printed in a not-so-readable way. >> In any case, if one takes the pre-processing route, the end encoding >> will be UTF-8. > > But then the pre-processor will have to guess the encoding (if it is > not the same for all the files), which we know is not simple. Yes.