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

Specify output utf-8 encoding explicitly #428

Open
Lev135 opened this issue Nov 9, 2022 · 0 comments · May be fixed by #434
Open

Specify output utf-8 encoding explicitly #428

Lev135 opened this issue Nov 9, 2022 · 0 comments · May be fixed by #434

Comments

@Lev135
Copy link
Contributor

Lev135 commented Nov 9, 2022

I'm working on windows and using unicode syntax in the source code, processed by stylish lead to the following error:

*** Exception: tmp/Main.hs: withFile: invalid argument (invalid character)

This issue can be solved by adding one line into the stylish executable:

IO.withFile path IO.WriteMode $ \h -> do
+ IO.hSetEncoding h IO.utf8
  setNewlineMode h
  IO.hPutStr h new

Nevertheless, maybe this issue can occur somewhere else (if there are another places, where we write a stylish output to the file)? If they are, I think we should add this there too.

@Lev135 Lev135 linked a pull request Dec 24, 2022 that will close this issue
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 a pull request may close this issue.

1 participant