Use UTF-8 by default for IO
Motivation
The default encoding for IO operations like readFile
or readProcess
depend on the system locale setting and falls back to ASCII
. It causes a pain for many people with run-time failures when reading/writing UTF-8-encoded contents. In most modern environments, UTF-8 is the de-facto standard encoding and we should prefer UTF-8 over ASCII.
Proposal
Make UTF-8 the default encoding when the system locale is not set or when something like $LANG
is C
.
Or even always use UTF-8 by default regardless what the system's locale is, unless the user explicitly passes/sets the encoding in their code.