class RSpec::Support::Differ

def handle_encoding_errors(actual, expected)

def handle_encoding_errors(actual, expected)
  if actual.source_encoding != expected.source_encoding
    "Could not produce a diff because the encoding of the actual string " \
    "(#{actual.source_encoding}) differs from the encoding of the expected " \
    "string (#{expected.source_encoding})"
  else
    "Could not produce a diff because of the encoding of the string " \
    "(#{expected.source_encoding})"
  end
end