Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Ondrej Pokorny
On 11.12.2015 09:10, "Jürgen Hestermann" wrote: UTF8Delete probably takes an AnsiString (or String) as var parameter and for var parameters the static codepages have to match exactly (String has CP_ACP while Utf8String has CP_UTF8). Just please help me understanding this: The unit LazUTF8 unit

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Jürgen Hestermann
>> For what else should I use UTF8delete if not for UTF8strings? >For "UTF8 strings". >An "UTF8String" and an "UTF8 String" are two different things for the >compiler. See below.   What is the difference? The link does not tell me.   As fas as I know, there is no (useful) usage of

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Sven Barth
Am 11.12.2015 08:20 schrieb "Martin Schreiber" : > > On Friday 11 December 2015 08:05:12 Sven Barth wrote: > > Am 10.12.2015 23:04 schrieb "Mattias Gaertner" < nc-gaert...@netcologne.de>: > > > > > > What about: > > > > > > UTF8Delete(AnsiString(Pointer(s)),1,1); > > > > While

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Mattias Gaertner
On Fri, 11 Dec 2015 09:10:42 +0100 "Jürgen Hestermann" wrote: > UTF8Delete probably takes an AnsiString (or String) as var parameter and for > var parameters the static codepages have to match exactly (String has CP_ACP > while Utf8String has CP_UTF8). > > Just

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Mattias Gaertner
On Fri, 11 Dec 2015 08:05:12 +0100 Sven Barth wrote: >[...] > > UTF8Delete(AnsiString(Pointer(s)),1,1); > > While the typecast itself would probably work I strongly advice against it > since you're relying on implementation details. True. > Also I doubt that you

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Mattias Gaertner
On Fri, 11 Dec 2015 14:32:14 +0200 Juha Manninen wrote: > On Fri, Dec 11, 2015 at 2:12 PM, Mattias Gaertner > wrote: > > On Fri, 11 Dec 2015 08:05:12 +0100 > > Sven Barth wrote: > >> Also I doubt that you can do

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Juha Manninen
On Fri, Dec 11, 2015 at 2:29 PM, "Jürgen Hestermann" wrote: > What is the difference? The link does not tell me. Did you actually read the wiki-page? The new UTF-8 system is explained there. It is a hack but a clever one. The latest chapter by Mattias explains why

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Jürgen Hestermann
>> >An "UTF8String" and an "UTF8 String" are two different things for the >> >compiler. See below. >> What is the difference? The link does not tell me. >An "UTF8 String" is a String encoded in UTF-8. >String and UTF8String are two different things for the compiler.   Of course String and

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Juha Manninen
On Fri, Dec 11, 2015 at 3:59 PM, Mattias Gaertner wrote: > The above literal requires {$codepage UTF8}. Damn right, I forgot to test that. It works. Juha -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Juha Manninen
On Fri, Dec 11, 2015 at 3:45 PM, Mattias Gaertner wrote: > With DisableUTF8RTL passing UTF8String to String changes encoding. Yes and a conversion between UTF-8 and a system codepage can be lossy. > So every function needs an overloaded wrapper function. > No need to

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Juha Manninen
On Fri, Dec 11, 2015 at 2:12 PM, Mattias Gaertner wrote: > On Fri, 11 Dec 2015 08:05:12 +0100 > Sven Barth wrote: >> Also I doubt that you can do this for var parameters... > > FPC 3.0 eats it without a hint. It does not work though.

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Mattias Gaertner
On Fri, 11 Dec 2015 13:29:28 +0100 "Jürgen Hestermann" wrote: >[...] > >An "UTF8String" and an "UTF8 String" are two different things for the > >compiler. See below. > > What is the difference? The link does not tell me. An "UTF8 String" is a String encoded in

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Juha Manninen
On Fri, Dec 11, 2015 at 4:10 PM, Mattias Gaertner wrote: > The job of the wrapper is to convert to type String without > triggering the conversion of the content. Ok, lots of ugly Pointer typecasts. Doable, yes. Juha -- ___

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Jürgen Hestermann
Am 2015-12-11 um 16:48 schrieb Graeme Geldenhuys: On 2015-12-11 13:23, Mattias Gaertner wrote: http://wiki.freepascal.org/Character_and_string_types I haven't seen that page yet. That is a brilliant explanation of the different string types. This really should live in the FPC Language Ref

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Mattias Gaertner
On Fri, 11 Dec 2015 15:20:14 +0100 "Jürgen Hestermann" wrote: >[...] > >An "UTF8 String" is a String encoded in UTF-8. >[...] > I know the type "UTF8String" but what is an "UTF8 String" (which you say > differs)? You lost me here. Maybe I can help you if you explain

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Juha Manninen
On Fri, Dec 11, 2015 at 6:26 PM, Jürgen Hestermann wrote: > Are there any other string types with UTF8 encoding in Free Pascal? Yes. The type "String" has a default encoding of UTF-8 when you use the new Unicode support in Lazarus. See the wiki page for technical

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Jürgen Hestermann
Am 2015-12-11 um 16:28 schrieb Juha Manninen: On Fri, Dec 11, 2015 at 4:20 PM, "Jürgen Hestermann" wrote: I know the type "UTF8String" but what is an "UTF8 String" (which you say differs)? "UTF8 String" is a String which has UTF-8 encoding. Our UTF-8 system changes

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Jürgen Hestermann
Am 2015-12-11 um 17:09 schrieb Mattias Gaertner: On Fri, 11 Dec 2015 15:20:14 +0100 "Jürgen Hestermann" wrote: [...] An "UTF8 String" is a String encoded in UTF-8. [...] I know the type "UTF8String" but what is an "UTF8 String" (which you say differs)? You lost

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Graeme Geldenhuys
On 2015-12-11 13:23, Mattias Gaertner wrote: > > http://wiki.freepascal.org/Character_and_string_types I haven't seen that page yet. That is a brilliant explanation of the different string types. This really should live in the FPC Language Ref document too. Thanks for sharing. ;-) Regards, -

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Mattias Gaertner
On Fri, 11 Dec 2015 17:29:18 +0100 Jürgen Hestermann wrote: >[...] > Be aware that this wiki is outdated (not FPC 3.0). > It says: > > Currently, the type *UTF8String* is an alias to the type *AnsiString >

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Mattias Gaertner
On Fri, 11 Dec 2015 17:20:40 +0100 Jürgen Hestermann wrote: >[...] > And I am wondering why these functions in LazUTF8 unit > (which only work with UTF8 strings) do not use UTF8String > as parameter. I'm sorry. This was answered several times. Probably there is some

Re: [Lazarus] IDE Font

2015-12-11 Thread Mattias Gaertner
On Fri, 11 Dec 2015 14:23:35 -0500 Anthony Walter wrote: > Can someone tell me before I create a fix, does there exist something > inside Lazarus to change the font of the controls which make up the Lazarus > IDE? The IDE use the LCL, which uses the font of the widgetset. Some

Re: [Lazarus] IDE Font

2015-12-11 Thread Anthony Walter
Okay, after some research I found an easy way to fix the problem. I thought this might be useful to others. You can easily define your own styles and change theme for Gtk2. Just create a files called ~/.gtkrc-2.0 and put whatever settings you prefer into it. For example to change the default font

Re: [Lazarus] IDE Font

2015-12-11 Thread Anthony Walter
Mattias, when I changed the Raspbian fonts (specifically the sizes) using the Raspbian tools the IDE font sizes do not reflect that change. I tried rebooting and the Lazarus fonts sizes are unchanged. I rebuilt Lazarus and the font sizes are unchanged. --

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Juha Manninen
On Fri, Dec 11, 2015 at 4:20 PM, "Jürgen Hestermann" wrote: > I know the type "UTF8String" but what is an "UTF8 String" (which you say > differs)? "UTF8 String" is a String which has UTF-8 encoding. Our UTF-8 system changes the default codepage of String to UTF-8 and

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Sven Barth
On 11.12.2015 15:14, Juha Manninen wrote: On Fri, Dec 11, 2015 at 4:10 PM, Mattias Gaertner wrote: The job of the wrapper is to convert to type String without triggering the conversion of the content. Ok, lots of ugly Pointer typecasts. Doable, yes. Not

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Sven Barth
On 11.12.2015 15:20, "Jürgen Hestermann" wrote: >My link explains some differences important for Lazarus. But it does not explain the difference between an "UTF8String" and an "UTF8 String" >The encoding hassle is built into Windows. The compiler cannot overcome >it. It can only give you

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Sven Barth
On 11.12.2015 13:12, Mattias Gaertner wrote: On Fri, 11 Dec 2015 08:05:12 +0100 Sven Barth wrote: [...] UTF8Delete(AnsiString(Pointer(s)),1,1); While the typecast itself would probably work I strongly advice against it since you're relying on implementation

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Jürgen Hestermann
UTF8Delete probably takes an AnsiString (or String) as var parameter and for var parameters the static codepages have to match exactly (String has CP_ACP while Utf8String has CP_UTF8).   Just please help me understanding this: The unit LazUTF8 unit is for manipulating UTF8 strings only,

[Lazarus] Libraries delayed loading

2015-12-11 Thread Aradeonas
Hi, I have many libraries and all the wrappers are static and I cant change all of them to dynamic loading but I want to put them in different folder my program root. It seems there is "delayed" option is in Delphi that give you time to SetDllDirectory and change the path before loading dll. And

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Mattias Gaertner
On Fri, 11 Dec 2015 15:02:45 +0200 Juha Manninen wrote: >[...] > FYI Ondrej, having overloaded versions only for procedures taking var > parameters makes no sense even when using DisableUTF8RTL. Lossy > conversion would happen in every function using "String" type.

Re: [Lazarus] UTF8String and UTF8Delete

2015-12-11 Thread Mattias Gaertner
On Fri, 11 Dec 2015 16:03:03 +0200 Juha Manninen wrote: >[...] > The functions then use String with system codepage. > A wrapper would trigger useless conversions and potentially loose data. > No, UTF8String really must be used in the implementation. The job of the

[Lazarus] IDE Font

2015-12-11 Thread Anthony Walter
Can someone tell me before I create a fix, does there exist something inside Lazarus to change the font of the controls which make up the Lazarus IDE? Purpose: I lowered the desktop resolution in Raspbian from 1920x1080 to 1366x768. Unfortunately at that smaller size the fonts being used by