[fpc-pascal] TStringHelper and Utf8String

Bart bartjunk64 at gmail.com
Fri Aug 28 15:43:07 CEST 2026


On Thu, Aug 27, 2026 at 11:30 PM Thomas Kurz via fpc-pascal
<fpc-pascal at lists.freepascal.org> wrote:

>   S := 'äfoo';
>   writeln (String(S).IndexOf('f')); // prints "2", as expected

As expected?
In the Utf8String 'f' will be at index 3, since the 'ä' will take up 2
bytes in UTF8-encoding.


-- 
Bart


More information about the fpc-pascal mailing list