jekyll-slack icon indicating copy to clipboard operation
jekyll-slack copied to clipboard

found invalid Unicode character escape code while parsing a quoted scalar

Open wkoffel opened this issue 8 years ago • 2 comments

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?

wkoffel avatar Jun 26 '16 16:06 wkoffel

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?

mdlincoln avatar Jun 29 '16 20:06 mdlincoln

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

wkoffel avatar Jun 30 '16 03:06 wkoffel