Error with Mustache directive on UTF-8 Json file
ngirard opened this issue · comments
ngirard commented
Using latest pp
.
Create test.json
containing
{ "attr": "é" }
and test.md
containing
!mustache(test.json)
\```````````````````````````````````````
{{attr}}
\```````````````````````````````````````
pp -html < test.md
fails with the following error message:
pp: Mustache (test.json): Error in $: Failed reading: Cannot decode input: Data.Text.Internal.Encoding.decodeUtf8: Invalid UTF-8 stream
ngirard commented
On-topic: https://stackoverflow.com/questions/27669418
Two people advised using encodeUtf8 :: Text -> ByteString
from Data.Text.Encoding
instead of pack
from Data.ByteString.Lazy.Char8
Christophe Delord commented
Thanks. This fixes the bug. I'll release a new version soon.
ngirard commented
Great, thanks !
Christophe Delord commented
Fixed in 2.7.3.