You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Locale sensitive file encoding and decoding laughs in our face. When you use Data.Text.IO.readFile, it plays a mind reading game of trying to deduce from clues you don’t care about which character encoding to use. These days, on the vast majority of systems used by native English speakers, this turns out to be UTF-8. So using readFile and writeFile typically “just works.” Using functions from Data.Text.IO looks safe, and can easily get hidden in a large PR or a library dependency.
IOW readFile decodes bytes using an encoding selected based on locale inference (from env vars like LANG and such).
Our use of readFile is just for reading a key file which I guess should always be ASCII but it looks like this may still break if the locale env vars are unset.
The text was updated successfully, but these errors were encountered:
From https://www.snoyman.com/blog/2020/10/haskell-bad-parts-1:
IOW readFile decodes bytes using an encoding selected based on locale inference (from env vars like
LANG
and such).Our use of
readFile
is just for reading a key file which I guess should always be ASCII but it looks like this may still break if the locale env vars are unset.The text was updated successfully, but these errors were encountered: