>It returns 41. Seems to be correct. >I'm using fpc 2.0.2. Greek k suggested when sample project I up, is in position 21 in the string, not 41. When using sample project, I get following relults while search for each character in "String to search in" edit box: - 1st: position: 1 - correct - 2nd: position: 3 - wrong - 3rd: position: 5 - wrong - 4th: position: 7 - wrong and so on
I also use FPC 2.0.2 downloaded a few days ago at ftp://ftp.de.freepascal.org/pub/fpc/dist/i386-linux-2.0.2/fpc-2.0.2.i386 -linux.tar. An ftp server choosed in Germany, I suppose all server support same build. Panagiotis -----Original Message----- From: Mattias Gaertner [mailto:[EMAIL PROTECTED] Sent: Monday, February 27, 2006 4:29 PM To: lazarus@miraclec.com Subject: Re: [lazarus] String functions on non latin text On Mon, 27 Feb 2006 16:08:52 +0200 "Panagiotis Sidiropoulos" <[EMAIL PROTECTED]> wrote: > Please download sample project at: > - www.magentadb.gr/ftp/pos-sample.zip It returns 41. Seems to be correct. I'm using fpc 2.0.2. Mattias > > Panagiotis > > > -----Original Message----- > From: Mattias Gaertner [mailto:[EMAIL PROTECTED] > Sent: Monday, February 27, 2006 3:10 PM > To: lazarus@miraclec.com > Subject: Re: [lazarus] String functions on non latin text > > > On Mon, 27 Feb 2006 15:03:17 +0200 > "Panagiotis Sidiropoulos" <[EMAIL PROTECTED]> wrote: > > > Unfortunatelly, even after checking syntax (system.pos()) I get same > > strange behaviour, I can't seek in a string. > > Maybe you can send a complete example? (zipped) > > Mattias > > > > > > Panagiotis > > > > > > -----Original Message----- > > From: Mattias Gaertner [mailto:[EMAIL PROTECTED] > > Sent: Monday, February 27, 2006 1:27 PM > > To: lazarus@miraclec.com > > Subject: Re: [lazarus] String functions on non latin text > > > > > > On Mon, 27 Feb 2006 15:17:41 +0200 > > Panagiotis Sidiropoulos <[EMAIL PROTECTED]> wrote: > > > > > Functions such as POS() and COPY(), return strange result when > > > used with utf8 text. > > > > > > Forr example, if your try > > > pos( '__', > > > > '_____________________________________________________________________ > > > > > ____________________________________________________________________ > > __ > > _- > > ' > > > ) you will get 1, which is incorrect. > > > > > > I know this has to do with utf encoding (2 or more bytes per > > > character). > > > > > > Any ideas? > > > > UTF8 works with System.Pos. Just make sure you use ansistring or > > shortstring, not widestring. > > > > > > Mattias > > > > _________________________________________________________________ > > To unsubscribe: mail [EMAIL PROTECTED] with > > "unsubscribe" as the Subject > > archives at http://www.lazarus.freepascal.org/mailarchives > > > > _________________________________________________________________ > > To unsubscribe: mail [EMAIL PROTECTED] with > > "unsubscribe" as the Subject > > archives at http://www.lazarus.freepascal.org/mailarchives > > _________________________________________________________________ > To unsubscribe: mail [EMAIL PROTECTED] with > "unsubscribe" as the Subject > archives at http://www.lazarus.freepascal.org/mailarchives > > _________________________________________________________________ > To unsubscribe: mail [EMAIL PROTECTED] with > "unsubscribe" as the Subject > archives at http://www.lazarus.freepascal.org/mailarchives _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives