0

This might be a simple question, but I want to make sure.

I want some comments in my .c files to use symbols not supported in the default encoding. If I save the file as UTF-8 for instance, and I only use symbols in comments, is there any way this can affect the compiler in any way?

Need to be sure of this.

uniquenamehere
  • 1,869
  • 3
  • 31
  • 60
  • 1
    Captain obvious is obvious: you cannot use UTF-8 characters in function or variable names (or `char`s). As long as you only use them in strings and comments, you are fine. – cutsoy Nov 10 '13 at 17:49
  • 1
    @Tim: It depends on C mode and compiler version -- see [Is it possible to get GCC to compile UTF-8 with BOM source files?](http://stackoverflow.com/questions/7899795/is-it-possible-to-get-gcc-to-compile-utf-8-with-bom-source-files) and comments therein. – Jongware Nov 10 '13 at 18:21
  • 1
    Oops -- seems this is still in the experimental phase with gcc. It works but requires you to enter extended characters as '\uXXXX', which kind of defeats the purpose. – Jongware Nov 10 '13 at 18:31
  • @Jongware: I was only asking about special characters/ UTF-8 in comments not in code, but I value your input and it was interesting reading. – uniquenamehere Nov 10 '13 at 20:48
  • At least it shows "the" C standard (1978) is still under active development. I love the built-in UTF8 support in what's rapidly becoming my *second* preferred programming language: Javascript. There is something very satisfying about having a line `π=2;`. – Jongware Nov 10 '13 at 21:37
  • Satisfying? Seems horrifying to me. – Markus Koivisto Nov 11 '13 at 07:13

1 Answers1

4

No, the preprocessor will strip all of that out anyway.

Markus Koivisto
  • 609
  • 3
  • 6