Skip to content

Allow Console Output In UTF-8 #378

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

Merged
merged 1 commit into from
May 20, 2019

Conversation

NoMoreFood
Copy link

- Address issue where console output does not display UTF-8 string properly.
- Resolves PowerShell/Win32-OpenSSH#1225
@@ -65,5 +65,7 @@ snmprintf(char *buf, size_t len, int *written, const char *fmt, ...)
void
msetlocale(void)
{
// allow console output of unicode characters
SetConsoleOutputCP(CP_UTF8);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this changes console code page without user's intention ?
Users can work around by explicitly running
chcp 65001

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manojampalam Yes, it will change the console code page. SSH mucks with window size, colors, scroll bars, titles, etc. Is this fundamentally different?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@NoMoreFood agree, and that's some thing we need to work in the long term to redesign and have ssh client either work on an isolated console window (not sure if possible) or restore the console settings to original state at clean up (possible but not robust).

In the mean time, do you feel this change is necessary given the workaround that lets users manage their code pages explicitly?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@manojampalam Since I don't have any analytics to make an informed decision, I can't say I have a strong opinion. My gut says that it's probably a good change to make to support international users, but it won't hurt my feelings if you don't think it's worth the risk of mucking with console settings.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a problem to do this.

Sets the output code page used by the console associated with the calling process. A console uses its output code page to translate the character values written by the various output functions into the images displayed in the console window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SFTP, SSH unicode display issues.
3 participants