Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Explicitly set text encoding to utf-8? #337

@wz1000

Description

@wz1000

I've been running into a build failure with ghc-lib-parser-9.12.2.20250421, where on a fresh docker image I get

*** Exception: compiler/GHC/Parser.y: hGetContents: invalid argument (cannot decode byte sequence starting from 226`:

The locale on this image is:

LANG=
LANGUAGE=
LC_CTYPE="POSIX"
LC_NUMERIC="POSIX"
LC_TIME="POSIX"
LC_COLLATE="POSIX"
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

Setting LC_ALL=C.UTF-8 gets rid of the error, but since Haskell source files (and transitively happy files) are specified to be UTF-8, I wonder if the right thing to do could be to explicitly set the encoding for both happy input and output to UTF-8.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions