… this is a huge topic
I assumed you were using UTF8
if you are on visual studio… and you are doing string = “π”;
this is not utf8
wstring is not utf8 wchar is not utf8
string is not single byte, utf8 is not singlebyte…
string is an array of chars ergo, an array of bytes
a utf8 char is not a single byte, (unless is ascii char) (utf8 isascii compatible)
so “π” cannot fit into a char.
it can fit to a char * or a wchar_t or a string
wchar_t is not singlebyte either…
wstring is an array of wchar_t.
so basically if you have an array of wchar_t FORGET ALL OF THE ABOVE.
wstring can be browsed by characters in loop without all this fuzzz utf8 because it varies internally it is not supposed to be used as such
what platform are you on?
what is the poco iterator returning when you pass a string = “π” in it.
then… everything else depends on the above two actually…
maybe you dont need the poco iterator but just use wstring + utf16
I assumed you have a unicode UTF-8 encoded string and you want to browse through the characters.
if you have a L"π" that is not UTF-8 that is unicode widechar whatever… probably utf-16
the above process will not work.
regarding wide-char multibyte and loosing data… that is a HUGE topic…
and there is SOOOO much wrong terminology and misconceptions
a good place to start is this: