Curious effect in Command Prompt "Type" command

  • Thread starter Thread starter Prophet
  • Start date Start date
  • Tags Tags
    Curious Type
Click For Summary

Discussion Overview

The discussion revolves around a peculiar issue encountered when using the TYPE command in the Command Prompt, where a hyphen in a text file is displayed as a lowercase 'u' with a grave accent. Participants explore potential causes, including font and code page settings, as well as the impact of different Windows versions.

Discussion Character

  • Exploratory
  • Debate/contested
  • Technical explanation

Main Points Raised

  • One participant notes the issue of a hyphen being replaced by a special character when displayed using the TYPE command, suggesting it is a curious effect.
  • Another participant mentions that dashes can be confused with hyphens and provides keyboard shortcuts for different dash types, recommending the use of a hex editor to identify the character encoding.
  • A participant suggests that the problem may be related to using an older (32-bit) version of Windows and recommends changing raster fonts to Lucida Console.
  • In contrast, another participant argues that the issue is related to code page settings rather than font or Windows version, stating that the command prompt uses code page 850 while most Windows programs use code page 1252.
  • One participant expresses doubt about the code page explanation, claiming they resolved the issue on their system and that it works fine on Windows 8.1, 64-bit.
  • Another participant questions the effectiveness of the proposed solutions and suggests that additional information about the original poster's Windows version would be helpful.

Areas of Agreement / Disagreement

Participants express differing views on whether the issue is related to font settings, code page configurations, or Windows versions. No consensus is reached, and multiple competing explanations remain in the discussion.

Contextual Notes

Participants reference specific code pages and font types, but the discussion does not resolve the underlying assumptions or limitations regarding the character display issue.

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.
 
Computer science 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: 536
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:

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 30 ·
2
Replies
30
Views
4K
Replies
10
Views
5K
  • · Replies 14 ·
Replies
14
Views
6K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 7 ·
Replies
7
Views
9K
Replies
1
Views
2K