-1

Does anybody know why whenever I input \v, it outputs the male gender symbol? For example: hello world would be hello diagonal to world on the next line

If there is an explanation for this, what can I do to overcome or solve this?

Raymond Chen
  • 44,448
  • 11
  • 96
  • 135

1 Answers1

2

Hans Passant is correct: https://en.wikipedia.org/wiki/Code_page_437

\v, "vertical tab", is ASCII 11. Which is displayed as the male gender symbol on an IBM-compatible PC or DOS prompt using IBM code page 437.

There's no "solution".

Q: What do you want?

For "screen control" in text mode, I'd strongly encourage you to look at NCurses or equivalent.

Although I don't necessarily recommend it, some folks are perfectly happy using ANSI Escape Codes.

And of course you can always change the code page: https://itectec.com/superuser/change-default-code-page-of-windows-console-to-utf-8/

paulsm4
  • 114,292
  • 17
  • 138
  • 190
  • No because I believe \v would mean that for example, take a look at what would happen to hello world in this URL: https://stackoverflow.com/questions/3380538/what-is-a-vertical-tab – SoccerHalo_King123 Jun 04 '21 at 23:33
  • Your question is "Why do I see this symbol?" The answer is "that's the way IBM code page 437 renders ASCII 11". If your follow-on question is "How can I implement vertical tab in a DOS prompt", I gave a couple of options. There are probably other options as well. But you simply *CAN'T* "printf(\v)" and expect a DOS prompt configured as code page 437 to display anything different ;) [And that's all I have to say about that](https://i.pinimg.com/550x/45/9f/ac/459facd78b9dbaf6122bdf065188fec7.jpg) – paulsm4 Jun 04 '21 at 23:44
  • I understand now. Thank you – SoccerHalo_King123 Jun 05 '21 at 02:57
  • Great: I'm glad I could help. Please feel free to "upvote" and/or "accept" if you found this reply useful. And please feel free to share whatever you ultimately decide to do. – paulsm4 Jun 05 '21 at 03:23