1

(Before the question: I would appreciate if someone wouldn't flag this thread as a duplicate because as much as I searched there wasn't anything close to my problem, only other programming languages and compilers or different OS's)

I'm using Dev C++ and I was after debuging a program with greek characters (system("chcp 1253");)at the output, but when I ran it, all the characters were unreadable and this message above was seen:

enter image description here

Based on some pretty close questions on the web (here and here and here) I though that my path was also broken, so I checked it out with "check chcp" on cmd, where it showed the proper path (c:\Windows\System32\chcp.com).

screenshot here

Has anyone else has come up with the same issue?

Coursal
  • 1,387
  • 4
  • 17
  • 32
  • What happens when you run "check chcp" from your program using system? Or, similiarly, "where chcp"? – Anon Mail Apr 06 '17 at 19:58
  • "check chcp" gives me the same kind of error. I found a work-around where I put the whole path of chcp in my code [ system("C:\\Windows\\System32\\chcp.com 1253"); ], but i want to know what caused it and how can i fix it. – Coursal Apr 06 '17 at 20:00
  • yes it just happened to me with Dev-C. The weird thing is that I had installed TDM-GCC-32 first and then an empty Dev-C (without compiler) and this problem with dchp did not exist. However, as I had a problem with debugger, I uninstalled everything and reinstalled Dev-C with compiler and this error showed up. With your solution, it is tackled but I still wonder why it happened.. It's all Greek to me. – Yannis Dran Jan 10 '19 at 14:44
  • 1
    @YannisDran if I had to guess, I'd say that some software on your machine messed with your system's path and environment variables. A new compiler or a removal of another one might be responsible. Windows are very keen to these kind of 'quirks'. – Coursal Jan 10 '19 at 22:08

1 Answers1

1

To re-set the path of chcp to the compiler, I simply had to type the whole path from the Windows folder into my program:

system("C:\\Windows\\System32\\chcp.com 1253");

This also works without the full path:

system("chcp.com 1253");

And then I had to get rid of the ".com" portion of it, making it:

system("chcp 1253");

Still, kind of a work-around but time-saving and risk-free.

Coursal
  • 1,387
  • 4
  • 17
  • 32