Is there a way to determine the length of the found text?

Hi experts

I use the following code to find a text match:

Dim LocaleForSearch As New Locale("de_DE@collation=search")
FoundPos = MyText.IndexOf(offset, FindString, ComparisonOptions.CaseInsensitive, LocaleForSearch)

Say, MyText is “Ich muß gehen.”, and FindString = “muss”, above code sets FoundPos to 5, i.e. “muss” matches “muß”. (muss is modern German spelling, muß is the same word as spelled before the last major spelling reform.)

Is there any way to find the length of the found text, so I can accurately highlight it in a TextArea control? If possible I would want to use Xojo only, no plugins (as this is an free open source project) and if possible no declares, as this needs to work on macOS, Linux (Desktop an Pi) and Windows. Obviously I may use a different function for searching (as long as it provides the same locale aware results) or determine the length of the found string after I found the position.

Furthermore I have an issue with Mac style decomposed accented characters. Searching them works fine with the above call. However, IndexOf appears to return a character index whereas TextArea.SelectionStart appears to count codepoints, not “characters”. Therefore when I select the found text in the TextArea using SelectionStart and SelectionLength, the selection is off, if the SelectionStart is preceded by a decomposed accented character, at least on Windows, where I tested so far.

Note: The app currently uses a mix of API1 and API2. The GUI, i.e. all controls, are API1.

Does DesktopTextArea (API2) handle combining diacritics and other modifier codepoints (e.g. skin tone for emojis) correctly in regard to the requirement given here?

Isn’t the length of the found text equal to the length of FindString, by definition the way IndexOf works? What am I missing?