BSON::Binary.new does not accept binary encoded strings

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Critical - P2
    • 12_01_17
    • Affects Version/s: None
    • Component/s: BSON
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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

            Assignee:
            Emily Stolfo (Inactive)
            Reporter:
            Adam Wróbel
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: