1

When I visit any file under a certain file tree, emacs spits out this error:

These default coding systems were tried to encode text
in the buffer ‘ *temp file*’:
  (utf-8 (7862 . 4194279) (14646 . 4194279) (14670 . 4194291))
However, each of them encountered characters it couldn’t encode:
  utf-8 cannot encode these: \347 \347 \363

Click on a character (or switch to this window by ‘M-m w w’
and select the characters by RET) to jump to the place it appears,
where ‘M-m u C-x =’ will give information about it.

Select one of the safe coding systems listed below,
or cancel the writing with C-g and edit the buffer
   to remove or modify the problematic characters,
or specify any other coding system (and risk losing
   the problematic characters).

  raw-text no-conversion

after investigating for a bit, I found git-gutter's background timer was the culprit (with debug-on-entry on select-safe-coding-system). This first happened when trying (accidentally) to open a .xlsx with emacs on the same file tree.

How can I locate these problematic characters and remove them? is \347 is in decimal, octal or something else entirely?

I'm using spacemacs 0.999.0 @ emacs 27.1

TL;DR: how do I find the referenced problematic characters so I can remove them?

P.S.: if you saw a question that has this exact text but this P.S., it was me, I accidetally created a new account when trying to log in.

1 Answer 1

1

That's a character represented in octal format. You can see this by putting the cursor before ("on") it and hitting C-x =. You'll see something like this, where #o347 says it's octal 347:

Char: ç (231, #o347, #xe7, file #xE7) point=148 of 148 (99%) column=0

See also the Emacs manual, node Text Display.

Use C-q followed by the octal chars in question. You can do this any time, including during Isearch or query-replace. For example: C-s C-q 3 4 7 C-s searches for that character, and M-% C-q 3 4 7 RET RET RET does query-replace to remove occurrences of it.

2
  • Thanks! is there some variable I can set to prevent git-gutter from freaking out over theses characters? I cannot remove them, as they are from comments on source code (which are written in portuguese and use 'ç' and 'ó')
    – Luctins
    Jan 28 at 15:55
  • Sorry, I know nothing about git-gutter. I suggest you post a separate question about that.
    – Drew
    Jan 28 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.