2016. 10. 21. 12:38 keltezéssel, Juha Manninen via Lazarus írta:
for i:=1 to UTF8Length(s) do Write(UTF8Copy(s,i,1))
No, it not a good solution!
I predict that most your code can still use byte indexing. At some
point you will get a Heureka-moment like "hey, I don't need the
codepoint index when doing this task!".
Juha, thank you for your patience and sorry if I am a completely idiot
but... :-)
Why the below example better than a for loop with UTF8Length and
UTF8Copy for go through the string?
I hope my "Heureka-moment" coming shortly! :D
http://wiki.freepascal.org/UTF8_strings_and_characters#Iterating_over_string_analysing_individual_codepoints
Gabor
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
http://lists.lazarus-ide.org/listinfo/lazarus