benpickles / parklife

Render a Rack app (Rails/Sinatra/etc) to a static build so it can be served by Netlify, Now, GitHub Pages, S3, or any other web server.
https://www.benpickles.com/articles/90-introducing-parklife
MIT License
188 stars 7 forks source link

Prevent Encoding::UndefinedConversionError error when writing response #94

Closed benpickles closed 1 year ago

benpickles commented 1 year ago

I'm seeing this error when trying to write a particular xlsx file:

lib/parklife/utils.rb:37:in `write': "\\xEC" from ASCII-8BIT to UTF-8 (Encoding::UndefinedConversionError)

The fix is simple but I can't seem to create a test case for it 🤷🏻‍♂️