Added in 3.2.2. Will need to be added for JRuby 10 (3.4-compat). https://ruby-doc.org/3.2.2/exts/stringio/StringIO.html#method-i-set_encoding_by_bom