[Lazarus] Beyond Compare 4 built with Lazarus 1.2

Marc Santhoff M.Santhoff at web.de
Sun Dec 29 10:55:13 CET 2013


On Sa, 2013-12-28 at 22:06 -0200, Marcos Douglas wrote:
> On Sat, Dec 28, 2013 at 2:06 PM, Graeme Geldenhuys
> <graeme at geldenhuys.co.uk> wrote:
> > Hi Marcos,
> 
> Hi Graeme,
> 
> > I do agree a Unicode enabled RTL is required, but just curious...
> >
> > On 2013-12-28 13:51, Marcos Douglas wrote:
> >> 1. How can I make programs on Windows using FPC and Lazarus without
> >> problems with Unicode stuff?
> >
> > What problems would those be?
> 
> I talked about in thread "SysToUTF8/UTF8ToSys".
> It's a pain to code a huge system, with many packages on Windows,
> because I always have to think about what encoding to use depending on
> which part of the code (eg: RTL is AnsiString, LCL is UTF-8, Synapse
> is AnsiString, some own packages are AnsiString too, two are UTF-8,
> etc.)

One receipe is to use function wrappers for all relevant ones (without
knowing fpGUI much I think this may be what Graeme did):

1. Write your own string functions wrappers.
2. Use only your wrapper functions in your code.
3. If something changes in the future adapt or rewrite your wrappers,
not the complete source of your programs.

It's the same thing I personally do for floating point types. For
testing I need to have the ability to switch between single and double
or other types. So I define my own general basic float type and switch
it:

type
  //basefloat = single;
  //basefloat = double;
  basefloat = extended;

String are a little more work, but if your wrapper functions are inlined
there will be no problem, even if they do nothing at all.

HTH anyhow,
Marc

-- 
Marc Santhoff <M.Santhoff at web.de>





More information about the Lazarus mailing list