I have a UTF8 encoded string and I wish to extract the n-th character within that string and place it into a new string object by itself (such that it can be written onto the UI). If it was ASCII encoded (or a UTF16 wstring), I would just use myString.at(index). Naturally, this doesn't work with UTF8.
I'm trying to use the Poco::TextIterator with a Poco::Utf8Encoding object to iterate over the string in order to find the appropriate character. This seems fine, but when I dereference the iterator, it returns an int of the Unicode character. But I need this as a UTF8 encoded string.
How to I convert this unicode int value into a UTF8 encoded std::string object? This piece seems to be missing. I would of expected this functionality to be in the UTF8 class or Unicode class of Poco. Or is there something out in the standard library that I'm missing?