[Lazarus] How to use strings properly with fixes_1_6 and FPC 3.0.0?

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Oct 21 11:40:26 CEST 2016


On Fri, 21 Oct 2016 11:29:36 +0200
Gabor Boros via Lazarus <lazarus at lists.lazarus-ide.org> wrote:

> 2016. 10. 21. 10:24 keltezéssel, Juha Manninen via Lazarus írta:
> > A "character" in Unicode is an ambiguous term.
> > Often the good old byte (codeunit) access is very useful.
> > See:
> >  http://wiki.freepascal.org/UTF8_strings_and_characters  
> 
> I started with the wiki pages, but 2 about UTF8 in english is too much 
> for me and you pointed to a 3rd... :-)
> 
> On the above link at "Searching a substring" I read "Due to the special 
> nature of UTF8 you can simply use the normal string functions for 
> searching a sub-string.". But the example Where procedure returns this 
> for me: "The substring "á" is in the text "éáó" at byte position 3 and 
> at character position 1". Which incorrect because á is the 2nd character.

Thanks for the hint. I fixed it.

Mattias



More information about the Lazarus mailing list