[fpc-devel] TFieldDef.Size vs TField.Size
Martin Schreiber
mse00000 at gmail.com
Thu Feb 24 10:39:13 CET 2011
On Thursday 24 February 2011 10:16:43 michael.vancanneyt at wisa.be wrote:
> >> But here you implicitly assume that you have a fixed number of bytes per
> >> character. You should always be explicit about such things, since this
> >> is a non-trivial assumption.
> >
> > I don't understand.
>
> "tmsebufdataset stores string data as UnicodeString instead to use a fixed
> record layout."
>
> If you say "fixed record layout", this means you assume that each character
> uses the same amount of bytes, and that the size of the string is limited,
> otherwise I fail to see how you can have fixed record layout.
>
I really should learn English, but I fear i am too old for the task...
What I meant:
Original tbufdataset uses a fixed record layout where for every stringfield
memory is reserved to hold the maximum possible amount of bytes of the field.
MSEgui tmsebufdataset has a fixed record layout too but stores a UnicodeString
which actually is a pointer and uses sizeof(pointer) memory space in record
layout. The string data fetched/posted from/to the database is converted
from/to system encoding or utf-8 (can be selected with an option flag in the
dataset or the connection component) to utf-16 while fetching/posting the
data. Because MSEgui completely works with UnicodeString the users don't need
to convert the DB-encoding.
Martin
More information about the fpc-devel
mailing list