Re: [fpc-pascal] Case insensitive comparison of strings with non-ascii characters

2009-07-25 Thread theo
74ms Comparing Strings of 322 Chars 1 times where the 3rd char differs WideCompareText: 268ms unicodeinfo: 3ms WideUpperCase: 8ms Comparing identical Text of 322 Chars 1 times where one Text is all uppercase WideCompareText: 810ms unicodeinfo: 121ms WideUpperCase: 1076ms Regards Theo __

Re: [fpc-pascal] Case insensitive comparison of strings with non-ascii characters

2009-07-25 Thread theo
ngle-byte character). OK thanks. That's why I added the comment, because I was not sure ;-) So then one should compare UTF8Lengths or probably forget that shortcut, because calculating UTF8Lengths is not cheap. Do turkish systems behave differently for WideLowerCase('I')?

Re[2]: [fpc-pascal] Case insensitive comparison of strings with non-ascii characters

2009-07-26 Thread theo
; Write unicode functions in UTF8 is almost non-sense, most unicode operations are not like we are used in the ANSI world The latter is certainly true, but I don't understand what it has to do with UTF-8 or UTF-16. > The code is not optimized but if somebody wants to use them please ask Yes

Re: [fpc-pascal] Case insensitive comparison of strings with non-ascii characters

2009-07-26 Thread theo
> > They should, since the uppercase version of i is İ there (i.e., a > capital I with a dot on top). See e.g. > http://www.i18nguy.com/unicode/turkish-i18n.html > > Oh, Goodness. ;-) Thanks for the information. Regards Theo ___ f

Re: [fpc-pascal] Case insensitive comparison of strings with non-ascii characters

2009-07-26 Thread theo
I had uploaded the sources to zshare server with the link: Thanks, I'll have a look at it. ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] More WideString routines

2009-08-03 Thread theo
Felipe Monteiro de Carvalho schrieb: Hello, At the moment I need a widestring replacement for StrPos. I searched for WideStrPos in my FPC 2.2.2 but nothing came. Any ideas? StrPos is for PChar. Do you mean Pos? There are lots of versions of Pos. One of them is Function Pos (Const Substr :

Re: [fpc-pascal] DBus interface needs an update

2009-08-09 Thread theo
If somebody is still interested in HAL (I know that DeviceKit ist coming): I've made a header translation and a demo (translation of lshal.c) yesterday. It seems to work for me. http://www.theo.ch/lazarus/dbus/hal.tar.gz ___ fpc-pascal maillist - fpc-

Re: [fpc-pascal] DBus interface needs an update

2009-08-10 Thread theo
Florian Klaempfl schrieb: > Please create and attach it to an issue report so we don't forget it. > You mean using the bugtracker? If you like, you could also add the files to packages/dbus What do you prefer? Regards Theo ___ fpc-pasc

Re: [fpc-pascal] DBus interface needs an update

2009-08-10 Thread theo
quot;rocket-science" ;-) You can test them with the provided example lshalpas.pp. lshalpas should produce the same results as lshal http://linux.die.net/man/1/lshal So imho testing lshalpas is enough "review" ;-) Best regards Theo ___ fpc

Re: [fpc-pascal] Set of encoding conversion routines

2009-08-11 Thread theo
I just needed UTF-8 to Latin 1 ISO but I can't find a cross-platform solution. Remembering that UTF8ToAnsi doesn't solve the problem because it converts to the system encoding and not Latin 1 ISO. A simpe option might be: wides:=UTF8Decode(utf8s); widestringmanager.Wide2AnsiMoveProc:=...@

[fpc-pascal] Dynamic loading shared libraries

2009-08-11 Thread theo
Am I right, that with fpc it is only possible to write bindings for dynamically loading shared libraries (using LoadLibrary) the hard way? Meaning declare function like: init_alloc_root : procedure(root: PMEM_ROOT;block_size : Cardinal);extdecl; and then using GetProcedureAddress like: point

Re: [fpc-pascal] Dynamic loading shared libraries

2009-08-11 Thread theo
How would the easy way be? I've just been looking into some old Kylix sources: interface const LibName = ''; function XftDrawCreate(display: PDisplay; win: XID; vis: PVisual; colorm: longint): PXftDraw; cdecl; implementation function XftDrawCreate(display: PDisplay; win: XID; vis: PVisual

Re: [fpc-pascal] Dynamic loading shared libraries

2009-08-11 Thread theo
s for imports I was looking for something like "dynamic" Regards Theo ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Byte array manipulation

2009-08-16 Thread theo
AnsiString does not have problems with #0. Test: var aStr:AnsiString; begin aStr:='test-test-test'; aStr:=StringReplace(aStr,'-',#0,[rfReplaceAll]); //if you ouput now, you'll only see 'test'... aStr:=StringReplace(aStr,#0,'-',[rfReplaceAll]); //...but the text is still in the String; Edit1.text