Skip to content

Commit

Permalink
Open package.toml file with UTF8 locale
Browse files Browse the repository at this point in the history
  • Loading branch information
earlbread committed Aug 17, 2018
1 parent fe79548 commit 1829296
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ To be released.

- The `uri` type has completly gone; use `url` instead.
[[#126], [#281] by Jonghun Park]
- Fixed locale to open package.toml.
[[#290], [#322]]

### Docs target

Expand Down Expand Up @@ -60,6 +62,7 @@ To be released.
[#225]: https://github.com/nirum-lang/nirum/issues/225
[#281]: https://github.com/nirum-lang/nirum/pull/281
[#283]: https://github.com/spoqa/nirum/pull/283
[#290]: https://github.com/nirum-lang/nirum/issues/290
[#297]: https://github.com/nirum-lang/nirum/issues/297
[#300]: https://github.com/nirum-lang/nirum/pull/300
[#304]: https://github.com/nirum-lang/nirum/pull/304
Expand All @@ -68,6 +71,7 @@ To be released.
[#311]: https://github.com/nirum-lang/nirum/pull/311
[#318]: https://github.com/nirum-lang/nirum/pull/318
[#321]: https://github.com/nirum-lang/nirum/pull/321
[#322]: https://github.com/nirum-lang/nirum/pull/322
[CommonMark]: http://commonmark.org/
[table syntax extension]: https://github.github.com/gfm/#tables-extension-
[special attributes extension]: https://michelf.ca/projects/php-markdown/extra/#spe-attr
Expand Down
5 changes: 4 additions & 1 deletion src/Nirum/Package/Metadata.hs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import Data.Text (Text, append, snoc, unpack)
import Data.Text.Encoding (encodeUtf8)
import qualified Data.Text.IO as TIO
import System.FilePath ((</>))
import System.IO
import Text.Email.Parser (EmailAddress)
import qualified Text.Email.Validate as EV
import Text.InterpolatedString.Perl6 (qq)
Expand Down Expand Up @@ -217,7 +218,9 @@ parseMetadata metadataPath' tomlText = do

readMetadata :: Target t => FilePath -> IO (Either MetadataError (Metadata t))
readMetadata metadataPath' = do
tomlText <- TIO.readFile metadataPath'
h <- openFile metadataPath' ReadMode
hSetEncoding h utf8
tomlText <- TIO.hGetContents h
return $ parseMetadata metadataPath' tomlText

metadataPath :: FilePath -> FilePath
Expand Down

0 comments on commit 1829296

Please sign in to comment.