I copied and pasted the C code as:

int main(void)
   return 0;

to org's babel code block, when strike C-c C-c, it report error:

/tmp/babel-uaYVXU/C-src-Pd1SZs.c:11:6: error: stray ‘\240’ in program
   11 |    statements
      |      ^
/tmp/babel-uaYVXU/C-src-Pd1SZs.c:12:1: error: stray ‘\302’ in program
   12 |    return 0;
      | ^

Then I have to create a new file and employ iconv to tackle the problem as:

iconv -f utf-8 -t ascii//translit input.c > output.

Is it possible to use iconv directly on the region of selected codes?

  • 2
    C-u M-x shell-command-on-region? – Fran Burstall Jul 4 '20 at 13:25
  • It would be simpler of course if you could eliminate those characters from the program text in the first place. They did not magically appear: somebody put them there. – NickD Jul 4 '20 at 16:19

Your Answer

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

Browse other questions tagged or ask your own question.