Curious effect in Command Prompt "Type" command

  • Thread starter Thread starter Prophet
  • Start date Start date
  • Tags Tags
    Curious Type
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
6 replies · 2K views
Prophet
Messages
18
Reaction score
0
I create a text file using notepad or any other text editor or word processor. There is a hyphen in the file. If I then display that file using the TYPE command in the Command Prompt then that hyphen gets replaced with a lower case u with a GRAVE symbol over it. What's going on?

No big deal. Just a curious effect.
 
Physics news on Phys.org
Dashes are often mistaken for hyphens, and visa versa.
"Em dash" is ù (keyboard shortcut Alt 151).
"En dash" is û (keyboard shortcut Alt 150).
Hypnen-minus is what is on your keyboard.

When in doubt, open the file with a hex editor/viewer, and see what value is used to represent the mystery special character. The DEBUG command will work in a pinch (use 'D' to dump file contents to the screen)..
 
Last edited:
Prophet said:
I create a text file using notepad or any other text editor or word processor. There is a hyphen in the file. If I then display that file using the TYPE command in the Command Prompt then that hyphen gets replaced with a lower case u with a GRAVE symbol over it. What's going on?

No big deal. Just a curious effect.

Chances are that you are using an older (32 bit) version of Windows (the command runs perfectly in newer 64 bit versions). Now, it turns out that this is usually not a code page problem but a font problem. Try to change "raster fonts" to "Lucida Console".
 
QuantumQuest said:
Chances are that you are using an older (32 bit) version of Windows (the command runs perfectly in newer 64 bit versions). Now, it turns out that this is usually not a code page problem but a font problem. Try to change "raster fonts" to "Lucida Console".

It is a code page version and not a font problem, nor a windows version problem.
It will still happen with windows 10, 64 bits and the same font in both notepad and the console.
The command prompt uses code page 850 (old ibm compatible ascii + block graphics stuff) and most windows programs use code page 1252.
Use chcp in a command prompt to change this or the ChangeConsoleCP Winapi function in a program that outputs to a console, and you get all those different dashes. (if the they are in the font you use, but all the fonts you can use in the console in windows 10 seem to have them)
 
willem2 said:
It is a code page version and not a font problem, nor a windows version problem.

I advise you not to be so sure about that. At least to my understanding of the description of the problem, it is not a code page problem. I have successfully solved it for myself.

willem2 said:
It will still happen with windows 10, 64 bits and the same font in both notepad and the console.

I don't know about Windows 10 (I can't check it right now) but in Windows 8.1, 64 bits runs without any kind of problem. The hyphen prints in the console perfectly.

willem2 said:
Use chcp in a command prompt to change this or the ChangeConsoleCP Winapi function in a program that outputs to a console, and you get all those different dashes.

This does not solve the display problem.
 
Last edited:
QuantumQuest said:
This does not solve the display problem.

No?

upload_2017-7-2_16-56-13.png
 

Attachments

  • upload_2017-7-2_16-55-42.png
    upload_2017-7-2_16-55-42.png
    14.4 KB · Views: 547
No?

In a similar situation for me this didn't work. I hope that I'm clear enough. I could upload snapshots as well but let the OP say which one solves his problem.

EDIT: Also, in order to have a more complete picture of the problem, it would be helpful if @Prophet can tell us which version of Windows is running.
 
Last edited: