Re: [fpc-pascal] TPersistent overhead

2016-03-25 Thread Michael Van Canneyt
On Sat, 26 Mar 2016, Ryan Joseph wrote: What are all the performance costs associated with subclassing TPersistent for RTTI information? I want to use this in some classes but unfortunately the way my code is written I need to basically make all my classes descend from TPersistent, even class

[fpc-pascal] TPersistent overhead

2016-03-25 Thread Ryan Joseph
What are all the performance costs associated with subclassing TPersistent for RTTI information? I want to use this in some classes but unfortunately the way my code is written I need to basically make all my classes descend from TPersistent, even classes that don’t need RTTI information. I not

[fpc-pascal] [heaptrc] no output for weblaz projects.

2016-03-25 Thread Thierry B.
Hi, I use heaptrc unit without any problem, using Lazarus project options. Now I try fcl-web applications (curently fphttpapp) and... heaptrc does not work. I see the heap.trc file creation in the project directory, but the file in simply empty. I wonder if it is working for someone else. -

Re: [fpc-pascal] UnicodeString and Length() function

2016-03-25 Thread Graeme Geldenhuys
On 2016-03-25 19:26, Jonas Maebe wrote: > It returns the number of ansi/widechars. In case of ansichars, that > equals the number of bytes. Ah, not bytes, so Length returns the number of elements [like in an array]. Thanks for clearing that up. Regards, - Graeme -

Re: [fpc-pascal] UnicodeString and Length() function

2016-03-25 Thread Jonas Maebe
On 25/03/16 20:21, Graeme Geldenhuys wrote: Length() returns the number of bytes, correct? It returns the number of ansi/widechars. In case of ansichars, that equals the number of bytes. So why isn't the result 8 and 14? The letter o with acute is 2-bytes in UTF8 ($C3 & $B4). That depend

[fpc-pascal] UnicodeString and Length() function

2016-03-25 Thread Graeme Geldenhuys
I never really used the UnicodeString (or WideString for that matter) - I've always used AnsiString with UTF-8 content. I also have my own UTF8 functions Copy(), Length() etc. Looking at UnicodeString - with FPC 2.6.4 I seem a bit confused. :-/ Take the following code: =

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Michael Van Canneyt
On Fri, 25 Mar 2016, Graeme Geldenhuys wrote: On 2016-03-25 12:23, Michael Van Canneyt wrote: Correction, this particular function does not depend on cwstrings. When you say "this particular function" you are referring to the UTF8Decode() function correct? The documentation page for UTF8De

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Graeme Geldenhuys
On 2016-03-25 12:23, Michael Van Canneyt wrote: > Correction, this particular function does not depend on cwstrings. When you say "this particular function" you are referring to the UTF8Decode() function correct? The documentation page for UTF8Decode has explicitly removed the reference [that it

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Juha Manninen
On Fri, Mar 25, 2016 at 7:14 PM, Bart wrote: > It's just a define to signal that all strings in LCL are UTF8 and when > offered to RTL their codepage is CP_UTF8. Not only in LCL. Package LazUtils / unit LazUTF8 can be used also without LCL. http://wiki.freepascal.org/Better_Unicode_Support_in_

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Bart
On 3/25/16, Felipe Monteiro de Carvalho wrote: > Important part you are forgetting: {$IFDEF UTF8_RTL} > > I don't know why it is needed in the utf-8 RTL, since I haven't used > this RTL yet, but in the RTL that I am using it doesn't depend in that > unit :) It's just a define to signal that all

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Felipe Monteiro de Carvalho
On Fri, Mar 25, 2016 at 3:16 PM, Michael Van Canneyt wrote: > "lazutf8 doesn't depending" when it is in the uses clause, sounds a bit > strange to me :-) Important part you are forgetting: {$IFDEF UTF8_RTL} I don't know why it is needed in the utf-8 RTL, since I haven't used this RTL yet, but in

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Martin Schreiber
On Friday 25 March 2016 15:37:36 Graeme Geldenhuys wrote: > On 2016-03-25 14:06, Martin Schreiber wrote: > > You can use the MSEgui functions in lib/common/msestrings.pas > > Thanks, but doesn't MSEgui also use cwstrings? > Not for utf-8 <-> utf-16 conversion. The MSEgui version of cwstring also ma

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Graeme Geldenhuys
On 2016-03-25 14:06, Martin Schreiber wrote: > You can use the MSEgui functions in lib/common/msestrings.pas Thanks, but doesn't MSEgui also use cwstrings? Regards, - Graeme - ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.f

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Michael Van Canneyt
On Fri, 25 Mar 2016, Felipe Monteiro de Carvalho wrote: On Fri, Mar 25, 2016 at 2:01 PM, Michael Van Canneyt wrote: Look at the sources Which proves me right, or do I miss something? "lazutf8 doesn't depending" when it is in the uses clause, sounds a bit strange to me :-) Michael. ___

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said: > >> > Yes, this is correct. > > Correction, this particular function does not depend on cwstrings. > > All the other widestring (uppercase, compare etc) functions do. > > Ok, thanks for that. > Is there an easy way to see when a RTL function requ

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Martin Schreiber
On Friday 25 March 2016 14:48:18 Graeme Geldenhuys wrote: > On 2016-03-25 12:20, Bart wrote: > > If you're using LazUtf8 (or use LCL) then cwstring will be used in your > > app. > > I don't use LCL at all, pure RTL & FCL code only. Based on the fact that > LCL's code also requires "cwstrings" I ass

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Graeme Geldenhuys
On 2016-03-25 12:23, Michael Van Canneyt wrote: >> > Yes, this is correct. > Correction, this particular function does not depend on cwstrings. > All the other widestring (uppercase, compare etc) functions do. Ok, thanks for that. Is there an easy way to see when a RTL function requires cwstring

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Felipe Monteiro de Carvalho
On Fri, Mar 25, 2016 at 2:01 PM, Michael Van Canneyt wrote: > Look at the sources Which proves me right, or do I miss something? -- Felipe Monteiro de Carvalho ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Graeme Geldenhuys
On 2016-03-25 12:20, Bart wrote: > If you're using LazUtf8 (or use LCL) then cwstring will be used in your app. I don't use LCL at all, pure RTL & FCL code only. Based on the fact that LCL's code also requires "cwstrings" I assume my original assumptions is correct, that if I want to do any UTF8-

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Michael Van Canneyt
On Fri, 25 Mar 2016, Felipe Monteiro de Carvalho wrote: On Fri, Mar 25, 2016 at 1:20 PM, Bart wrote: If you're using LazUtf8 (or use LCL) then cwstring will be used in your app. And I guess that Utf8ToUtf16 from Lazutf8 does not depend on a WS manager, but I may be terribly wrong about that.

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Felipe Monteiro de Carvalho
On Fri, Mar 25, 2016 at 1:20 PM, Bart wrote: > If you're using LazUtf8 (or use LCL) then cwstring will be used in your app. > And I guess that Utf8ToUtf16 from Lazutf8 does not depend on a WS > manager, but I may be terribly wrong about that. As far as I remember, lazutf8 doesn't depending on cws

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Michael Van Canneyt
On Fri, 25 Mar 2016, Michael Van Canneyt wrote: On Fri, 25 Mar 2016, Graeme Geldenhuys wrote: Hi, I'm using FPC 2.6.4 primarily. Am I correct in that UTF8Decode and most (if not all) UTF8-to-UTF16 conversions don't function correctly (or not at all) if you don't include the cwstrings unit

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Michael Van Canneyt
On Fri, 25 Mar 2016, Graeme Geldenhuys wrote: Hi, I'm using FPC 2.6.4 primarily. Am I correct in that UTF8Decode and most (if not all) UTF8-to-UTF16 conversions don't function correctly (or not at all) if you don't include the cwstrings unit in your project? I referring to Unix-based OSes her

Re: [fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Bart
On 3/25/16, Graeme Geldenhuys wrote: > I'm using FPC 2.6.4 primarily. Am I correct in that UTF8Decode and most > (if not all) UTF8-to-UTF16 conversions don't function correctly (or not > at all) if you don't include the cwstrings unit in your project? I > referring to Unix-based OSes here. If yo

[fpc-pascal] cwstrings unit and UTF8Decode()

2016-03-25 Thread Graeme Geldenhuys
Hi, I'm using FPC 2.6.4 primarily. Am I correct in that UTF8Decode and most (if not all) UTF8-to-UTF16 conversions don't function correctly (or not at all) if you don't include the cwstrings unit in your project? I referring to Unix-based OSes here. I believe Windows automatically include the Wide