compiler construction - Using "umlauts" in C++ code -


possible duplicate:
c++ source in unicode

i discovered line of code in project:

string überwachung; 

i surprised, because thought not allowed use umlauts 'äöü' in c++ code other in strings , on, , result in compiler error. compiles fine visual studio 2008.

  • is special microsoft feature, or umlauts allowed other compilers too?
  • are there potential problems (portability,system language settings..)?
  • i can remember not allowed. when did change?

kind regards clarification

p.s.: tool cppcheck mark usage error, though compiles

gcc complains on it: codepad

: error: stray '\303' in program

the c++ language standard limits basic source character set 91 printable characters plus tabs, form feed , new-line, within ascii. however, there's nice footnote:

the glyphs members of basic source character set intended identify characters subset of iso/iec 10646 corresponds ascii character set. however, because mapping source file characters source character set (described in translation phase 1) specified implementation-defined, implementation required document how basic source characters represented in source files.

.. translation phase 1 (emphasis mine)

physical source file characters mapped, in implementation-defined manner, basic source character set (introducing new-line characters end-of-line indicators) if necessary. the set of physical source file characters accepted implementation-defined.

generally, shouldn't use umlauts or other special characters in code. if may work, if does, it's compiler-specific feature.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -