I'm trying to generate different colors to enhance the visibility of the output from the programs I'm writing but it's not working no matter what I do.

I'm on a Windows 7 x64 environment with a UTF-8 encoded command line prompt. I have checked that the terminal is fully capable of generating ANSI colors.

I think the problem is with the escape character that gets mangled by the printf() command. When using '\0033' or '\x1b' or even the escape character itself, the output becomes 'â†' instead of the true escape character when encoding it in ANSI (i.e. non-unicode).

Does anyone know what's going on and/or how to get around this? Strangely, I cannot find any solution elsewhere and I'm currently restricted to using C and VisualStudio. I can't see that the lacking ANSI.sys support is the problem here either as it is a character that get's mangled in the conversion to unicode or whatever is taking place.