This would probably be better in #encode specs. It should also be significantly simplified. If I understand correctly, the spec states that encoding a substring of an ascii-8bit string as a utf-8 string (assuming the bytes encode correctly) should succeed. (If I'm mistaken, please correct me.) This suggests a two-line spec along the lines of:

```ruby
str = "\x82foo".force_encoding("ascii-8bit")[1..-1].encode("utf-8")
str.should == encode(foo, "utf-8")
```

Other specs should already establish that #force_encoding, #encode, #[], etc. work as expected.