CDSoft / pp

PP - Generic preprocessor (with pandoc in mind) - macros, literate programming, diagrams, scripts...

Home Page:http://cdelord.fr/pp

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with Mustache directive on UTF-8 Json file

ngirard opened this issue · comments

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

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

Thanks. This fixes the bug. I'll release a new version soon.

Great, thanks !

Fixed in 2.7.3.