jnicklas/capybara — pull request #1223 by cschramm (2014-01-07 17:48:48+00:00)
Title: Improve save_page for binary content

In my case the response body contained a PNG file and capybara-screenshot called save_page (due to https://github.com/mattheworiordan/capybara-screenshot/pull/69). This results in an Encoding::UndefinedConversionError since the body is treated as text and a conversion from ASCII to UTF-8 is applied, but the PNG - of course - contains invalid bytes.