jekyll-slack
jekyll-slack copied to clipboard
found invalid Unicode character escape code while parsing a quoted scalar
In many of my JSON files, I get a unicode error from the jekyll-slack generator:
Configuration file: /Users/wkoffel/dev/slack-archive/_config.yml
Source: /Users/wkoffel/dev/slack-archive
Destination: /Users/wkoffel/dev/slack-archive/_site
Incremental build: disabled. Enable with --incremental
Generating...
jekyll 3.1.6 | Error: (/Users/wkoffel/dev/slack-archive/_data/content/2015-12-02.json): found invalid Unicode character escape code while parsing a quoted scalar at line 24 column 21
The line in question contains an emoji (smiley face), output in the Slack json as:
"file": {
"id": "F0FQ1B5TK",
"created": 1449111471,
"timestamp": 1449111471,
"name": "Curator goes rogue \ud83d\ude04 .png",
"title": "Curator goes rogue :smile:",
"mimetype": "image/jpeg",
<etc...>
}
Is this an issue with global jekyll configuration? Or something about the jekyll-slack parsing?
Did you preprocess the original JSON as specified in the README? Is the JSON text you pasted in the issue from before or after this preprocessing?
Yes, I preprocessed as directed, and yes, this is the JSON from after the preprocessing.
Just in case I'm rusty on my find
/sed
usage, I ran this in the jekyll project root. I assume that it overwrites the original files with the substitutions.
$ find _data/ -name '*.json' -exec sed -i '' -e 's/\\\//\//g' {} \;
$ jekyll build