[fpc-devel] String collating (oops)
befelemepeseveze at gmail.com
Wed Oct 1 23:26:11 CEST 2008
can anybody please comment on the following?
Bellow is a simple function, returning "M9,MD,P6".
function F: String;
with TStringList.Create do
Sorted := True;
Result := CommaText;
It does so in a console program, but if invoked from within a GUI app,
the result is "MD,M9,P6" on my system (Ubuntu 8.04.1):
Linux mypc 2.6.24-21-generic #1 SMP Mon Aug 25 17:32:09 UTC 2008 i686 GNU/Linux
FPC SVN revision 11845
Lazarus SVN revision 16831
I've traced the execution of TStringList.Add downto calling strcoll()
from libc (on rtl/unix/cwstring.pp line 578) which - to my surprise -
returns opposite signed results in the console and gui variants
for the same compare pair "MD" and "M9". There is possibly some
difference in the initialization of an application which causes this
and which also could be bound to my non English locale. Or it may be a
bug somewhere in the libc/RTL/LCL? (of course it may be also an error
between my seat and keyboard :-)
I was not yet able to find out if this is a bug at all or just the
intended string collating of a Czech locale.
Any feedback would be appreciated.
PS: This is a resend of my previous post, now WITHOUT the attachment
as it (?) rendered the message unreadable. Sorry for any
More information about the fpc-devel