Skip to content

Specify output utf-8 encoding explicitly  #428

Open
@Lev135

Description

@Lev135

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions