Running under nginx+passenger throws an encoding error #183

merged 3 commits into from May 17, 2012


None yet

3 participants

jcoglan commented May 13, 2012

If you try to serve a Showoff deck under nginx+passenger, you get this when trying to load the slides:

ArgumentError - invalid byte sequence in US-ASCII:
    /home/jcoglan/www/ `process_markdown'
    /home/jcoglan/www/ `block (2 levels) in get_slides_html'
    /home/jcoglan/www/ `each'
    /home/jcoglan/www/ `block in get_slides_html'
    /home/jcoglan/www/ `each'
    /home/jcoglan/www/ `get_slides_html'
    /home/jcoglan/www/ `slides'

This patch forces the Markdown content to UTF-8 encoding to stop the error.


I don't think this is the best approach. Enforcing UTF-8 is not the way to go, imho. However, having an encoding option in the showoff.json file seems like a good idea to me.

jcoglan commented May 17, 2012

Done. App now has an encoding setting in my branch. I went with this over a field in showoff.json this because this makes it easier to configure many decks at once if hosting several on the same host, e.g. see


Why can't they co-exist?

I'm thinking about the folks that know nothing about Sinatra/Rack and just want to run a simple presentation in UTF-16?

jcoglan commented May 17, 2012

See latest commit -- encoding is read from showoff.json but can be overridden through the class API.

@goncalossilva goncalossilva merged commit fa6af29 into schacon:master May 17, 2012

Nice, thanks!

it's great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment