It looks like MRI will attempt coerce it to a string. So the check might have to be something like

```RUBY
if encoding.kind_of? Encoding
  external = encoding
else
  encoding = Rubinius::Type.coerce_to encoding, String, :to_str
  external, internal = encoding.split(':')
end
```

Does that look reasonable?