Problem with displaying ascii escape sequences [duplicate]

  ansi-escape, c++, console, python, windows

I tried to display colored characters using ascii escape sequences, but it shows weird character and the option I set.
"[0M" ← this is the copy and pasted character from command prompt.
I think this should not be printed by system.

I tried to use escape sequences using both python interpreter and C codes running on Windows command prompt.
The C compiler is GNU compiler.

here is the python code.

>>> print("12345[5D67890")
12345[5D67890

and C code.

#include <stdio.h>

int main()
{
    printf("123453[5D67890n");
}

and results

12345[5D67890

I noticed that the browser or something doesn’t show my weird character properly, here is the screenshot of my weird character

my weird character

also I copy and paste my weird character into ascii to keycode converter. It shows that the weird character’s keycode is "027" which is the escape sequence keycode in denary number.

Source: Windows Questions

LEAVE A COMMENT