[fpc-pascal] TStringHelper and Utf8String
wkitty42 at windstream.net
wkitty42 at windstream.net
Fri Aug 28 16:41:17 CEST 2026
On 8/28/26 9:43 AM, Bart via fpc-pascal wrote:
> 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.
ummm... is it in that writeln, though? looks to me like the UTF8 is cast to an
old school mono-byte String type ;)
More information about the fpc-pascal
mailing list