[Lazarus] TDBEdit shows 4 characters from a Char(1) field

Martin Schreiber fpmse at bluewin.ch
Tue Aug 5 13:12:02 CEST 2008


On Tuesday 05 August 2008 12.46:52 Graeme Geldenhuys wrote:
> On 8/5/08, Graeme Geldenhuys <graemeg.lists at gmail.com> wrote:
> >  I'm going to try and access the field without the TDBEdit control
> >  (from code) to see what it's length is....
>
> And this was the result:
>
>   s = <a   > with length = 4
>
>
> So it seems the issue is not in Lazarus, but SqlDB?  Maybe I should
> raise this issue in the fpc-devel mailing list.  I'm first going to
> read up a bit more on utf-8 support in Firebird 2 - maybe FB has some
> strange behaviour.
>
Firebird returns the storage size in bytes and not the character length as 
field size. MSEgui DB components convert from utf-8 or the system encoding to 
widestring while fetching the field data. The field character length is get 
from Firebird metadata and applied to tmsestringfield as field size for 16 
bit characters.
You are right, this does not work for Klingon. :-)

Martin



More information about the Lazarus mailing list