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

Unicode causes printing errors on Windows #253

Closed
ericpinter opened this issue Sep 21, 2020 · 4 comments
Closed

Unicode causes printing errors on Windows #253

ericpinter opened this issue Sep 21, 2020 · 4 comments
Labels
A-Under Review C-Low Hanging Fruit Shouldn't take too much time; ideal issues for new contributors. S-Nice to have Minor importance U-UI Z-Bug

Comments

@ericpinter
Copy link
Collaborator

When printing a result that contains a Unicode character that character and everything after is replaced with an error like <stdout>: commitBuffer: invalid argument (invalid character). This seems to be Windows specific, and still occurs in environments that support Unicode (i.e. Windows' new terminal). A workaround is executing chcp 65001 to put the shell UTF-8 Mode, though this seems like it might be a better solution. Perhaps we can find a way to make Windows' shell go into UTF-8 when running the language or at least mention this in the setup documentation.

@byorgey
Copy link
Member

byorgey commented Dec 11, 2021

This is relevant: https://mail.haskell.org/pipermail/haskell-cafe/2021-November/134818.html

What version of GHC are your students using? I believe sufficiently
recent versions of ghc (but I don't know which; this may require
9.2.1) have an RTS option to use a new I/O manager, which among other
things implements the widechar API for console I/O.

I found an email from Tamar
https://mail.haskell.org/pipermail/ghc-devs/2020-July/019053.html
that says the new Windows I/O manager is available in 8.12+, and is enabled with
+RTS --io-manager=native

@byorgey
Copy link
Member

byorgey commented Mar 25, 2022

Students have definitely been running into this. Now that the latest stack LTS-19.0 has moved to GHC 9.0, we should try upgrading to that and specifying +RTS --io-manager=native in the .cabal file.

@byorgey byorgey reopened this May 26, 2022
@byorgey
Copy link
Member

byorgey commented May 26, 2022

Did what the above comment suggests --- upgraded to LTS-19.8 and added that GHC option to use the native IO manager. Someone on Windows will have to check whether this resolves the issue.

@byorgey byorgey added C-Low Hanging Fruit Shouldn't take too much time; ideal issues for new contributors. A-Under Review labels Feb 10, 2024
@byorgey
Copy link
Member

byorgey commented Sep 16, 2024

Going to close this for now.

@byorgey byorgey closed this as completed Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Under Review C-Low Hanging Fruit Shouldn't take too much time; ideal issues for new contributors. S-Nice to have Minor importance U-UI Z-Bug
Projects
None yet
Development

No branches or pull requests

2 participants