Add spec for sprintf and encodings

Adds a spec for when the arguments have an encoding that is compatible
with the format, but where the argument's encoding has multibyte
character support and the format doesn't.

Extract from #2325
Use string_build encoding protocol for sprintf

Instead of forcing the encoding on the result, we always start to build
the string with an empty string with the format's encoding. This makes
sure the encoding follows the proper support and will come out correct.

Fixes #2325