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/slides.jcoglan.com/app/vendor/showoff/lib/showoff.rb:356:in `block (2 levels) in get_slides_html'
/home/jcoglan/www/slides.jcoglan.com/app/vendor/showoff/lib/showoff.rb:354:in `block in get_slides_html'
This patch forces the Markdown content to UTF-8 encoding to stop the error.
Force content files to UTF-8 encoding to make them working under ngin…
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.
Make encoding-forcing user-configurable.
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 https://github.com/jcoglan/presentations/blob/master/config.ru#L4-11
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?
Allow encoding to be set through showoff.json.
See latest commit -- encoding is read from showoff.json but can be overridden through the class API.