0

I just started using the ncurses library that came with my MinGW64, gcc 5.3.0 on a Windows 7 machine. With the following code:

initscr();
noecho();
raw();
keypad(stdscr, TRUE);
printw("Hello there.");
getmaxyx(stdscr, row, col);
printw("\nRow: %3d", row);
printw("\nCol: %3d", col);
printw("\nSomething %c", 0x2605);
refresh();
endwin();

I get this as output:

enter image description here

I've tried changing the font in the command line, which didn't help. And I can't find anything on Google for why it's doing that. Changing my linking from ncursesw to ncurses doesn't help.

What can I do to fix this so that it prints out normally without all of the extra spacing?

Thanks.

Blerg
  • 163
  • 9
  • Is there a function `print` besides `printw`? It looks like an encoding issue to me... – aschipfl Aug 28 '19 at 21:22
  • Added a picture to show the problem at hand a bit better. @aschipfl That command is basically Print to Window, so the W so I believe that it's not using wide. I do agree that it's probably an encoding issue of some kind, just not sure about it yet. – Blerg Aug 28 '19 at 22:30
  • It's unlikely a fault or misconfigured setting of `cmd.exe`. Does `BVCS.exe` not have configurable options? If not, you're going to have to implement a conversion somehow. – Compo Aug 28 '19 at 23:49
  • It's a program I just started writing to learn ncurses. So, no configuration at this time. – Blerg Aug 29 '19 at 00:26
  • If you haven't already found it on your searches, take a look at [this Super User question and answers](https://superuser.com/q/269818). – Compo Aug 29 '19 at 10:04
  • Changing the code pages does not fix the issue. `raw()` simply disables input buffering and should not affect output at all. Even without calling `raw()` it shows the same signs. – Blerg Aug 29 '19 at 17:45

1 Answers1

0

Updating to the latest version of MinGW64 resolved the issue for me. The gcc version is 8.1.0.

Blerg
  • 163
  • 9