Op 2011-02-17 11:28, Michael Schnell het geskryf: > On 02/17/2011 07:19 AM, Jürgen Hestermann wrote: >> >> I often search for substrings, delete them from the string, insert >> other strings at certain places, etc. >> How can you do all this without knowledge of the internal structure of >> the string? > This (magically :-) ) does work with UTF8.
NO, it doesn't! You can't use FPC's Copy(), Pos() etc reliably with UTF-8 text, because thouse RTL functions work purely on ANSI text (1-byte characters - speaking of String type text here) and don't know about multi-byte characters, combining diacritics etc. Hence LCL and fpGUI have special functions similar to RTL, that knows how to work with UTF-8 encoded text. eg: UTF8Pos(), UTF8Length and UTF8Copy() etc functions. Regards, - Graeme - -- fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/ -- _______________________________________________ Lazarus mailing list [email protected] http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
