Add spec for encoded string and partial match

Extracted from #2253
Remove unneccessary sindex usage in String::character_index

This was causing the index variable to be increased twice in certain
loops, causing a wrong index to be returned. Looks like the additional
sindex is also not necessary, so remove that usage as well.

Fixes #2253
Set call frame before another case of potential internalization
Set call frame when checking async events
Implement correct priority of "-" in format strings under 1.9

Ruby 1.9 and 2.0 give higher priority to the "-" (left justify) operator
than to the "0" (pad with zeros) operator when used in format string in
conjunction with numeric values.

See http://ujihisa.blogspot.com/2009/12/string-differs-between-ruby-18-and-19.html
for details.