[fpc-devel] Unicodestring branch, please test and help fixing

Michael Van Canneyt michael at freepascal.org
Thu Sep 11 10:31:54 CEST 2008



On Thu, 11 Sep 2008, Anton Kavalenka wrote:

> Florian Klaempfl wrote:
> > Graeme Geldenhuys schrieb:
> >   
> > > Remember, Unicode support is much more that simply storing and
> > > displaying text. You have various encodings, RTL or LTR direction etc.
> > > I can't see how a simple type can keep track of all such information
> > > - but then, I don't know the internals of FPC either.  ;-)
> > >     
> >
> > How would an OOP approach solve this? The problem isn't the tracking of
> > things like encoding or directions but handling all these information.
> > _______________________________________________
> > fpc-devel maillist  -  fpc-devel at lists.freepascal.org
> > http://lists.freepascal.org/mailman/listinfo/fpc-devel
> >
> >   
> procedure TLabel.Paint(...)
> begin
>  if *Caption.IsRTL *then
>    DrawCaptionRTL(0,0,*Caption.AsUTF8*, flags)
> else
>    DrawCaption(0,0,*Caption.AsUTF8*, flags);
> end;
> 
> Is not that enough?

What is the gain as opposed to

 procedure TLabel.Paint(...)
 begin
  if IsRTL(Caption) then
    DrawCaptionRTL(0,0,AsUTF8(Caption), flags)
 else
    DrawCaption(0,0,AsUTF8(Caption), flags);
 end;

In other words where is the benefit from OOP in this ? 

Michael.



More information about the fpc-devel mailing list