Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix display of the "low ASCII" glyphs in PC code pages #1964

Merged
merged 2 commits into from
Sep 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 18 additions & 15 deletions src/host/_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -511,26 +511,29 @@ using Microsoft::Console::VirtualTerminal::StateMachine;
}
else
{
// As a special favor to incompetent apps that attempt to display control chars,
// convert to corresponding OEM Glyph Chars
WORD CharType;

GetStringTypeW(CT_CTYPE1, &RealUnicodeChar, 1, &CharType);
if (CharType == C1_CNTRL)
{
ConvertOutputToUnicode(gci.OutputCP,
(LPSTR)&RealUnicodeChar,
1,
LocalBufPtr,
1);
}
else if (Char == UNICODE_NULL)
if (Char == UNICODE_NULL)
{
*LocalBufPtr = UNICODE_SPACE;
}
else
{
*LocalBufPtr = Char;
// As a special favor to incompetent apps that attempt to display control chars,
// convert to corresponding OEM Glyph Chars
WORD CharType;

GetStringTypeW(CT_CTYPE1, &RealUnicodeChar, 1, &CharType);
if (WI_IsFlagSet(CharType, C1_CNTRL))
{
ConvertOutputToUnicode(gci.OutputCP,
(LPSTR)&RealUnicodeChar,
1,
LocalBufPtr,
1);
}
else
{
*LocalBufPtr = Char;
}
}

LocalBufPtr++;
Expand Down