Gah I had a big post here but my connection swallowed it.
sf::Utf fits the bill, but lacks direct support for strings. The iterator interface is good, but I think another layer could be put on top of that.
Currently, if you want to use sf::Utf to convert a string, it's a multi-step process that is very unintuitive for beginners:
std::string my8; // utf8 string
std::wstring my16; // utf16 string
// we want to convert my16 to my8
my8.resize( X ); // where 'X' is big enough to hold a my16 in UTF8 form.
std::string::iterator stop = sf::Utf<16>::ToUtf8( my16.begin(), my16.end(), my8.begin() );
my8.resize( stop - my8.begin() );
Not only is that overly complicated, but it's also error prone. The user shouldn't be expected to calculate X. That should be up to the conversion routine. There's not even any way to guard against potential overflow here, if X is calculated incorrectly.
I'd like to see something like this:
// simple:
my8 = sf::ToUtf8(my16);
// this would work too, but it's too verbose for my taste:
my8 = sf::Utf<16>::ToUtf8(my16);
With these kinds of conversion routines not fixed to any one class, the need for sf::String dissolves and can be replaced with std::basic_string.