in reply to Re: Read and write UTF-8
in thread Read and write UTF-8

it doesn't count the correct # of characters.

With no sample data, that's pretty hard to verify. Have you read length() miscounting UTF8 characters? There's lots of good info in there (length works analagously to substr) along with easy examples of how to provide code complete with data which demonstrates the issue.