SizeOfUtf8Char() returns npos on error, which will be picked up here.  I think this is OK as you never hit this error, but it's perhaps non-obvious?