Skip to content
This repository was archived by the owner on Oct 5, 2022. It is now read-only.

chcp 65001 before stylish-haskell on windows #11

Closed
cnd opened this issue May 26, 2016 · 7 comments
Closed

chcp 65001 before stylish-haskell on windows #11

cnd opened this issue May 26, 2016 · 7 comments

Comments

@cnd
Copy link

cnd commented May 26, 2016

for unicode support

@lierdakil
Copy link
Contributor

Since command is run as a child process, and not in the shell, chcp doesn't work as one would expect and breaks more things then it fixes. A better solution would be to have a patched version of stylish-haskell that sets stdio encoding to utf-8.

@cnd
Copy link
Author

cnd commented May 27, 2016

@lierdakil hm... I need more information of this, when I run stylish-haskell from console with chcp 65001 it actually works.

oh feels like I even created this issue in wrong project

@lierdakil
Copy link
Contributor

Consider this: chcp is guaranteed to work in terminal, and it changes encoding for current terminal as a whole. But Atom is a GUI application, it doesn't have an associated terminal. What will chcp do?

@cnd
Copy link
Author

cnd commented May 27, 2016

@lierdakil well but you can run stylish-haskell from shell, adding chcp 65001 && call before it, isn't it

I mean run from atom using some api which allows using OS shell... or even more uglier with cmd /C

@lierdakil
Copy link
Contributor

I believe back in the day I tried it with ghc-mod with rather dissapointing results. If you're feeling adventurous, you might test it like so (in developer console, assuming stylish-haskell is in PATH):

atom.workspace.getActiveTextEditor().setText(require('child_process').execSync('chcp 65001 ; stylish-haskell', {input: atom.workspace.getActiveTextEditor().getText(), stdio: 'pipe', encoding: 'utf-8'}))

Using cmd /C has its own set of challenges, but it might work. Might open a whole new can of worms though.

@cnd
Copy link
Author

cnd commented May 27, 2016

well it works but as start of file it adds Active code page: 65001

@lierdakil
Copy link
Contributor

Closing, since this is fixed by upstream.

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

No branches or pull requests

2 participants