[Lazarus] non Unicodode application

Mattias Gaertner nc-gaertnma at netcologne.de
Fri Feb 12 17:12:44 CET 2016


On Fri, 12 Feb 2016 16:41:23 +0100
Michael Schnell <mschnell at lumino.de> wrote:

> On 02/12/2016 03:54 PM, Juha Manninen wrote:
> > Sure there is hope. See the new UTF-8 support:
> >    http://wiki.freepascal.org/Better_Unicode_Support_in_Lazarus
> >
> This page says:
> 
> "This page covers Unicode support in Lazarus programs (console or 
> server, no GUI) and applications (GUI with LCL) using features of FPC 
> 3.0+. "
> "RTL with default codepage UTF-8"
> 
> That would mean that the type "String" is 8 Bit  ?

Yes, 8bit per Char.

 
> That would mean that 8 bit Strings are used in TStrings and hence in 
> TStringList ?

Yes.

 
> That would mean that (e.g.) storing 8 bit "String"s in a TStringList 
> would not do any conversion at all ?

Yes.

 
> And it would mean that pos() and friends work on 8 bit Strings (and wist 
> simple byte-positions and length)   ?

Yes.

 
> If string constants and strings coming from and going to the GUI are 
> implicitly converted, I suppose this is manageable.

Without UTF-8 mode you are responsible to convert the LCL UTF-8 strings
to whatever needed (probably system code page, UTF8ToSyS).

With UTF-8 mode all strings are by default UTF-8 and implicitely
converted when using functions like FileExists or
TStrings.LoadFromFile. If you want to work in system code page you have
to convert back and forth between RTL+LCL and your code. 

When converting a Delphi 7 application it depends on what charset(s) the
application supports to decide which mode is easier/better.

Just saying "uncoded strings in TCP/IP" is not enough information.
That can be done in both modes.
 
> Is all this is here to stay, I think my friend could use Lazarus and fpc 
> for his task.

Mattias




More information about the Lazarus mailing list