help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to search for characters displayed as octal codes in the buffer?


From: Dan Sommers
Subject: Re: How to search for characters displayed as octal codes in the buffer?
Date: Wed, 17 Jul 2019 06:33:28 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.0

On 7/16/19 8:43 PM, Noam Postavsky wrote:
On Sun, 14 Jul 2019 at 10:50, ndame <emacsuser@freemail.hu> wrote:

Sometimes I have unprintable characters in the buffer which display with an 
octal code (e.g. \232). instead of a character (text copied from elsewhere, 
etc.) How can I find these without knowing the exact codes?

I'd like to find all such places in the buffer where a character appears with 
an octal code, but I have UTF characters too in the buffer which display 
properly, so using nonascii is not the answer.

(re-search-forward "[\x80-\xff]") seems to work, though it's a bit
awkward to enter interactively:

C-M-s [ C-x 8 RET 3fff80 RET - C-x 8 RET 3fffff RET ]



Use quoted-insert (usually C-q) in the mini buffer once the
search is active.  One trick is that quoted-insert collects
digits until it sees a non-digit, so I often have to add and
then delete a space character to the search.

So to search for \232:

     C-s C-q 2 3 2 SPC <backspace>

HTH,
Dan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]