Just capturing some notes from Vekhir on IRC:
I've been investigating https://bugs.darcs.net/patch2296 and think
it is related to https://gitlab.haskell.org/ghc/ghc/-/issues/20344.
When darcs sets the LocaleEncoding in
https://hub.darcs.net/darcs/darcs-
screened/browse/src/Darcs/UI/External.hs#532,
darcs seems to assume that the return of getFileSystemEncoding is always
Unicode-compatible.
However, as above linked issue in GHC explains, getFileSystemEncoding can
also be ASCII. I have verified that GHC 9.0.2, 9.2.8, 9.4.8, and 9.6.3 all
return ASCII when LC_ALL=C is set.
I don't know why switch-encoding works in earlier versions of GHC (<9.6).
Perhaps some change in unix 2.8 causes the difference in behaviour.
2.7.2.2 (included in the earlier GHC versions) was first shipped with
GHC 8.2, so there's about 5 years worth of changes. I'm bound to versions
shipped with GHC, so can't investigate which commit if any causes the
issue.
|