-
-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
readFile family of functions should avoid or document their use of system locale? #146
Comments
@Ptival Documentation improvements are always appreciated. I don't think that switching to It's good to know that reading file as a |
Everyone links that, but it's very bad article.
|
@llelf Do you know any alternative to this blog post? If no, I'm okay with mentioning this blog post in the documentation for this module because it contains useful information. I personally don't expect from people programming in Haskell to be aware of all low-level details how OS works.
|
I would just go with something like this (without any links): These functions are for working with textual data, and are system and locale-sensitive (encoding, line-endings). But it's your prelude :) |
relude/src/Relude/File.hs
Line 48 in 57c865d
Data.Text.IO
'sreadFile
.This might be a source of problem, as described here:
https://www.snoyman.com/blog/2016/12/beware-of-readfile
Solutions could include
Data.ByteString.IO
(as is done in http://hackage.haskell.org/package/classy-prelude-1.5.0/docs/src/ClassyPrelude.html#readFile possibly providing areadFileUtf8
convenience)readFileWithSystemLocale
?)Right now, someone would have to read the
Relude.File
documentation, click on the link to theData.Text.IO
documentation, and then scroll up to see the text about locale.The text was updated successfully, but these errors were encountered: