title: Jekyll says Liquid Exception: invalid byte sequence in US-ASCII in documentation.html
body: <p>I'm trying to run <code>jekyll build</code> on GitLab CI.</p>
  
  <p>This is my <code>.gitlab-ci.yml</code>:</p>
  
  <pre><code>pages:
    script:
    - export LC_ALL=en_US.UTF-8
    - export LANG=en_US.UTF-8
    - gem install jekyll
    - jekyll build --destination public
    artifacts:
      paths:
      - public
  </code></pre>
  
  <p>When the task runs I get this error:</p>
  
  <pre><code>      Generating... 
    Liquid Exception: invalid byte sequence in US-ASCII in documentation.html
  jekyll 3.1.2 | Error:  invalid byte sequence in US-ASCII
  
  ERROR: Build failed with: exit code 1
  </code></pre>
  
  <hr>
  
  <h2>More informations</h2>
  
  <p><code>documentation.html</code> is:</p>
  
  <pre><code>---
  layout: page
  title: Documentation
  description: Learn how to create awesome poppers
  ---
  &lt;!-- This page is generated by the grunt doc task of the master branch! Don't edit it! --&gt;
  {% markdown documentation.md %}
  </code></pre>
  
  <p>And <code>documentation.md</code> is a markdown document generated by <code>grunt-jsdoc2md</code>.</p>
  
  <p>This is the <code>markdown</code> plugin I'm using:</p>
  
  <pre><code>=begin
    Jekyll tag to include Markdown text from _includes directory preprocessing with Liquid.
    Usage:
      {% markdown &lt;filename&gt; %}
    Dependency:
      - kramdown
  =end
  module Jekyll
    class MarkdownTag &lt; Liquid::Tag
      def initialize(tag_name, text, tokens)
        super
        @text = text.strip
      end
      require "kramdown"
      def render(context)
        tmpl = File.read File.join Dir.pwd, "_includes", @text
        site = context.registers[:site]
        tmpl = (Liquid::Template.parse tmpl).render site.site_payload
        html = Kramdown::Document.new(tmpl).to_html
      end
    end
  end
  Liquid::Template.register_tag('markdown', Jekyll::MarkdownTag)
  </code></pre>
  
  <hr>
  
  <h2>Attempts</h2>
  
  <p>As you see, I've already tried setting <code>LC_ALL</code> and <code>LANG</code> to <code>en_US.UTF-8</code>.</p>
  
  <p>I've also added <code>encoding: utf-8</code> to my <code>_config.yml</code> but it still doesn't work...</p>
  
  <p>Another attempt was to use <code>@text = text.encode("iso-8859-1").force_encoding("utf-8").strip</code> in the markdown plugin. </p>
  
  <p>Suggestions?</p>