rspec/rspec-core — pull request #1681 by JonRowe (2014-08-26 15:30:15+00:00)
Title: Handle cases where an exception is not encoded as UTF-8

Certain circumstances (looking at you `JSON.parse()` lead to `ASCII-8BIT` strings being mixed which `UTF-8` strings which cause RSpec to die. An example is if your spec file is UTF-8 and you use a UTF-8 character on the same line that causes the exception, RSpec will attempt to print the code and the exception in the same string, which will cause an Incompatible encoding exception.

The solution is to use the `EncodedString` class from support, (originally used in the differ) to encode these strings safely.

Fixes #1662