The patch in issue BSON-950 that was released as BSON gem 3.1.2 breaks BSON::Binary for strings that are not UTF8 encoded and which aren't UTF8 compatible. In Ruby `string.encode encoding` can fail with an exception as opposed to `string.force_encoding encoding`.
Gist with example failing code and it's output:
https://gist.github.com/amw/96b791e6c134a419528f
- is related to
-
RUBY-950 Incompatible character encodings: ASCII-8BIT and UTF-8 (Encoding::CompatibilityError)
- Closed