From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: 26.1.50; Emacs can't decode the text file on opening the file, but can decode it on revert-buffer Date: Mon, 05 Nov 2018 16:02:06 +0100 Message-ID: <87wopr36vl.fsf@rub.de> References: <16B3CA28-C893-4854-AD64-1C224C1EDDB2@outlook.com> <83efc0ew3f.fsf@gnu.org> <83bm74epfj.fsf@gnu.org> <492691df-5413-2f32-e9dc-8fe2ec6ccb14@orcon.net.nz> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1541430050 8371 195.159.176.226 (5 Nov 2018 15:00:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 5 Nov 2018 15:00:50 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Phil Sainty , Eli Zaretskii , "emacs-devel@gnu.org" To: Zhang Haijun Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 05 16:00:46 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJgMt-00020t-IA for ged-emacs-devel@m.gmane.org; Mon, 05 Nov 2018 16:00:43 +0100 Original-Received: from localhost ([::1]:35682 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJgOz-0000Tn-Us for ged-emacs-devel@m.gmane.org; Mon, 05 Nov 2018 10:02:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJgOm-0000HQ-IN for emacs-devel@gnu.org; Mon, 05 Nov 2018 10:02:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJgOg-0001Be-CH for emacs-devel@gnu.org; Mon, 05 Nov 2018 10:02:39 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:53371) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gJgOV-0007Cj-PU; Mon, 05 Nov 2018 10:02:26 -0500 Original-Received: from rosalinde ([178.6.151.171]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lmqxo-1fsIj5336q-00h3Cn; Mon, 05 Nov 2018 16:02:07 +0100 Original-Received: from rosalinde ([178.6.151.171]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0Lmqxo-1fsIj5336q-00h3Cn; Mon, 05 Nov 2018 16:02:07 +0100 In-Reply-To: (Zhang Haijun's message of "Mon, 5 Nov 2018 14:08:46 +0000") X-Provags-ID: V03:K1:BOhPO8dPMQMV3YgA1b0HjGNF3a48dNF7Yfx62y5t6yojAw3eZ2d Zb1pgMyRsBcers3Gm1Rx+Cpf1lZh4jkZ3GAw5WVL64eYtO89xZJ1t0KfYltuYwZMnYUk28Z DuAj/r89Mtxm/0UbMCrBu1ygKelSYaWGkmOiCbROqNYCf8otBFPj3uUtH4yhkMr5TG5n8Vo qbBfLV5mMuSpcPXCabsSQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:oNs3r4LYDy0=:nxv3Rwik1mFtQ+qojVfsto jB89h3+18aCM/SgBHTLm5u56yk0e37wAChsH8T0+y4Y1TUxFLKIpjHizkjJFm3QolsmeqSvEV 18odpjPuBOTWhnWTtiA1EYZtUdqVIIiI6311cZ+ateASrHw/4ry6/dZqtPnH4QOE8TQUBAd46 93VLBpm9uFc+VMObYdsb2tAFsPUCOdWkJznCR5/VWv05J0nJcXVaDZnaS24X4/Jp2XMi55CJP Ts9G1T2bxRmTTP0vbYlZ8P6WgDd8q3TPhNsovDqVD+3TfvrYxqbKj5V3sVYqVzk97jSA+In0e 3iA/EGzdjCA9QnEod++btemXm697OdS50gm3XJscmW14IHoHOhpEzgQzpwb4mXcHPV5LwW2Mb M45eq0+mahFNgW9h1f3ea3r0SKWsLA/IZ9uWrkz1qTyXvy123YJ0Fm6kEukyxliic2198CoRg AvCRUhKLtHMmVUe8Jcib4f5S0OLD4T3XAZR/FyDkC6vcLWkbUsj0ZeDV3o4k07oKjOqqbt9IW 7QIL+SMWOHwmvBJwSijcWoMtRVIvKULDuXrA3xxB/LVpu71bTHgxfITQLO5FP3S7pVI61ezYk gv1W+kc5i8ZRvdAXyu+kPCi5iYlmR3Cb77WIO7rJAGMijV4heTrv4e452JEqMiZtpd4GCIqYE vzZFioQMd5UqDdzSPFZEKlXDlKMrwOUgls3pgJKHTIf+9BtC7KDlfvhgiuA7hEwG9DqhxAj/e cnktxcVWMqjiWUX5kHMhR+nlerOA37TLt61Ph85K4N6v4zmWt5VPlIjqRyX4S7t468qqO7Rn X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.18 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:231026 Archived-At: On Mon, 5 Nov 2018 14:08:46 +0000 Zhang Haijun wrote: > On 11/05/2018 05:39 PM, Phil Sainty wrote: >> On 5/11/18 10:00 PM, Zhang Haijun wrote: >>> On 11/05/2018 01:13 AM, Eli Zaretskii wrote: >>>> They are not invalid bytes, they are zero bytes. You can search for >>>> them like this: >>>> >>>> C-s C-q C-SPC >>> >>> I mean chars like ^@, ^H and \342\200\230. How to search them? >> >> ^@ is the null char and Eli just showed you how to search for it. >> >> Similarly, C-s C-q C-h will search for a ^H char. >> >> Assuming \342\200\230 is three octal characters then, I would probably >> resort to editing the search string and using `insert-char': >> >> C-s M-e >> C-x 8 RET #o342 RET >> etc... >> >> If you can *see* an instance of the character already, you might just >> move point to that character and use C-s C-w (and maybe a bit of C-M-w >> if that grabs too many chars). >> >> Or if you mean "any non-ascii character" then the regexp [^[:ascii:]] >> will match those. >> >> >> -Phil >> > > I don't know the specific char to search. As the orignal problem I met, > I opened the text file. Emacs can't decode it and it didn't show any > warning message like position of the null byte. Then what should I do to > find the null byte(or other bytes which can prevent emacs from decoding)? > > How to search these unknown bytes? All of the above (the ascii control characters ^@ and ^H and octal characters like \342\200\230) are non-printing characters, so you can find them with this regexp isearch: `C-M-s [^[:print:]]'. Steve Berman