rspec/rspec-expectations — pull request #220 by JonRowe (2013-03-13 23:07:51+00:00)
Title: Encode diff literals according to the actual output encoding.

This is a partial fix for Issue #219, it forces the internal literals to use a matching encoding to one of the diffed encoding, reducing the chance of an encoding error being raised by RSpec. It doens't solve this for all, for example using mismatched encoded strings will still cause this error, but in such cases it won't be RSpec at fault but the user supplying differently encoded strings to comparison. It would be possible to rescue the encoding exception elsewhere in a matcher but that shouldn't be done in the diff IMO.