NO

Author Topic: UTF conversion within literal strings?  (Read 4275 times)

remod

  • Guest
UTF conversion within literal strings?
« on: May 24, 2010, 08:19:55 PM »
In my code I have strings like this: "\200A\201" which is meant to represent a pointer to the four bytes: {128,65,129,0}
those byte will be sent around during the program execution.

I get the following warning:

 warning #2223: Unable to convert character '\u0080' to codepage 1252; using default character.

that makes me thing that the code "\200" is actually interpreted as "\u0080". 

Unfortunately the warnings are not armless, the same program compiled with gcc and Visual C compiles and works as intended.

Frankly I'm a little bit surprised as I've not found anywhere that it is legitimate for a C compiler to do that conversion, the C standard suggests that each escape sequence has to be treated separately. But I might have missed something.

Is there any flag I should set to ensure that string literals are not interpreted as UTF-8?

Thanks,
    Remod.