readFileUTF8 -package:classy-prelude

Like readFile, but with the encoding utf8.
Read a file in UTF8 encoding, throwing an exception on invalid character encoding. This function will use OS-specific line ending handling.
Read a file strictly, as opposed to how readFile does it using lazy IO, but also disregard system locale and assume that the file is encoded in UTF-8. Haskell source files are expected to be encoded in UTF-8 by GHC.
A strict version of readFileUTF8, see readFile' for details.