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

ERL-424: Unicode Characters Not Displayed Correctly In Windows Console #3390

Closed
OTP-Maintainer opened this issue May 16, 2017 · 1 comment
Closed
Labels
bug Issue is reported as a bug help wanted Issue not worked on by OTP; help wanted from the community priority:medium team:VM Assigned to OTP team VM
Milestone

Comments

@OTP-Maintainer
Copy link

Original reporter: onoriocatenacci
Affected version: OTP-19.0
Component: erl_interface
Migrated from: https://bugs.erlang.org/browse/ERL-424


I have seen this issue [ERL-361|https://bugs.erlang.org/browse/ERL-361] and this seems related.  However the fix indicated in that issue doesn't work here.  

Reproduction Steps:
1.) Open Erl
2.) Paste: "ł".
3.) Output displayed is "l"

I've tried setting the console code page to both 65001 and 852 (since the character in question is Polish as far as I know) and neither fixes the issue.  However when I set the code page to 852 instead of getting "l" I get [136].

Windows 10 Pro x64 (Build 14393.1198)
OTP 19.

Any suggestions?
@OTP-Maintainer
Copy link
Author

dgud said:

The expected result of
1>  "ł".  is
[322]

erl on windows uses oldshell which only support ascii characters.

If you want strings (lists) with unicode codepoints to be displayed you will need to start erlang with +pc unicode

werl +pc unicode
1> "ł".
"ł".

Use werl on windows, (and select a font that can display unicode chars)
> io:format("[322,10]").
"ł".

erl  on windows or erl -oldshell  on linux
1> io:format([322,10]).
\x{142}

I don't know how input/pasting works in shell on windows or what you get there, I guess it depends on the shell as well, msys/cygwin/cmd.


@OTP-Maintainer OTP-Maintainer added bug Issue is reported as a bug help wanted Issue not worked on by OTP; help wanted from the community team:VM Assigned to OTP team VM priority:medium labels Feb 10, 2021
@garazdawi garazdawi added this to the OTP-26.0 milestone Apr 7, 2022
garazdawi added a commit to garazdawi/otp that referenced this issue Aug 28, 2022
This commit re-implements the entire tty driver for both Unix
and Windows to use a common nif instead of two seperate drivers.

The Unix implementation works pretty much as it did before only that
a lot more of the terminal logic has been moved from Erlang to C.

The windows implementation now uses Windows Terminal Sequences, i.e.
the same sequences as most Unixes to control the terminal. This means
that werl.exe is no longer needed and erl.exe will have the "newshell"
with all the features normally only found on Unix.

The new implementation also uses dirty I/O threads for all I/O which
means that it can leave the FDs in blocking mode. This fixes problems
when the Erlang tty is interacting with other systems such as bash.

Closes erlang#3150
Closes erlang#3390
Closes erlang#4343
garazdawi added a commit to garazdawi/otp that referenced this issue Aug 29, 2022
This commit re-implements the entire tty driver for both Unix
and Windows to use a common nif instead of two seperate drivers.

The Unix implementation works pretty much as it did before only that
a lot more of the terminal logic has been moved from Erlang to C.

The windows implementation now uses Windows Terminal Sequences, i.e.
the same sequences as most Unixes to control the terminal. This means
that werl.exe is no longer needed and erl.exe will have the "newshell"
with all the features normally only found on Unix.

The new implementation also uses dirty I/O threads for all I/O which
means that it can leave the FDs in blocking mode. This fixes problems
when the Erlang tty is interacting with other systems such as bash.

Closes erlang#3150
Closes erlang#3390
Closes erlang#4343
garazdawi added a commit to garazdawi/otp that referenced this issue Aug 29, 2022
This commit re-implements the entire tty driver for both Unix
and Windows to use a common nif instead of two seperate drivers.

The Unix implementation works pretty much as it did before only that
a lot more of the terminal logic has been moved from Erlang to C.

The windows implementation now uses Windows Terminal Sequences, i.e.
the same sequences as most Unixes to control the terminal. This means
that werl.exe is no longer needed and erl.exe will have the "newshell"
with all the features normally only found on Unix.

The new implementation also uses dirty I/O threads for all I/O which
means that it can leave the FDs in blocking mode. This fixes problems
when the Erlang tty is interacting with other systems such as bash.

Closes erlang#3150
Closes erlang#3390
Closes erlang#4343
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue is reported as a bug help wanted Issue not worked on by OTP; help wanted from the community priority:medium team:VM Assigned to OTP team VM
Projects
None yet
Development

No branches or pull requests

2 participants