getting Str(Len(txt)) utf8

I have this line of code that in a sense returns the correct length. It isn’t UTF-8 sensitive though.
Text: “?? ?? ??? ?? ???.” Str(Len(txt)) returns 31 instead of 18 (I think). Am I missing something?
Do I have to put something like .textencoding on the end of it, even though it’s elsewhere?
It might be a calculation thing because I can get textarea.charposxandY to work without any calculations.
The problem is it’s an odd number. When I debug for an equal english text “He went on his way at daybreak.” I also get 31 when I bring up that text to find it’s length in the debugger.

What encoding does the text have?
With UTF-8 it should work.

dim s as string = "?? ?? ???? ?? ???." MsgBox str(len(s))+" "+str(lenb(s))

shows 18 and 44 as it should be for UTF-8.

UTF8 on a Mac, if it matters. all of these files are definitely read-in that way.

when reading files, you need to specify an encoding, else the strings will just have bytes inside.

To clarify Christian’s point, strings always just have bytes inside. The encoding tells the App/OS how to interpret those bytes.

Thanks. I think I was reading something wrong.