Environment:
Ubuntu 8.04
firebird 2.0.4 on ubuntu 8.04 tcp connection
freepascal 2.2.3
lazarus r15343 gtk2
components:
UIB components + FBDataset
In database:
default charset: iso8859_1 (or win1252)
collate used: PT_BR
In lazarus:
set the characterset para *csUNICODE_FSS *in JvUIBDatabase.
Now, all is good.
The firebird server and firebird client manage the connection properly.
2008/7/26 Jesus Reyes
Show quoted text 156 lines
--- El vie 25-jul-08, Osvaldo TCF escribi?:
> De:: Osvaldo TCF
> Asunto: Re: [Lazarus] Firebirdsql Characters Compatibility
> A: "General mailing list"
> Fecha: viernes, 25 julio, 2008, 11:21 am
> You are right. But...
>
> Pearhaps the problem is in the way of componet get/send
> data from
> database. Not in lazarus.
>
Perharps there is no problem at all :)
> FirebirdSQL save data as is receved from the client, it use
> de charset
> and the collate for this.
This is not completly right, it seems all depends on three things, the
default charset the dataset was created, if not default especified, it
depends on fields specicif charset, and last and very important on
connection charset.
If database was created with default charset WIN1252 for example and fields
do not specify a different charset, then using a connection.charset:='UTF8'
will convert all data from WIN1252 to UTF8 on retrieving, so no changes are
needed in lazarus application (with unicode support enabled) except by
setting the right connection charset, this is IMO, the easiest way to solve
the problems. It works also on storing, storing a UTF8 encoded string in
database should be fine, provided that UTF8 string has chars that exists in
WIN1252 encoding if not, then problems will occur. That's why the best is
convert database to UTF8 when possible or when text with different languages
is expected.
>
> When i create a field with utf8 charset i see correct in
> all clients
> with support utf8: lazarus (use utf8, ever) and flamerobin
> (use defined
> charset).
it will be fine as long as flamerobin registration charset is UTF8 or some
charset that matches the data on database. It will not work if for example
reg charset is WIN1252 and data in database is russian text.
>
> The problem is how lazarus send/get data respecting the
> charset of
> component connection.
Conversions are done in database server provided that fields,tables and
database are correctly defined.
>
> Dataset.dataconvert? transliterate? more ideia?
>
> Thanks.
>
>
>
>
> Em Sex, 2008-07-25 ?s 14:52 +0200, Joost van der Sluis
> escreveu:
> > Op vrijdag 25-07-2008 om 09:35 uur [tijdzone -0300],
> schreef Osvaldo
> > TCF:
> > >
> > > environment
> > > ubuntu 8.04
> > > fpc 2.2.3
> > > lazarus gtk2 r15343
> > > firebird 2.0.4 win1252
> > > components tested: uib + uibdataset ; uib +
> fbdataset ; sqldb + sqlquery
> > >
> > > Problem:
> > > characters '?', '?',
> '?' (...) apear diferent in lazarus and flamerobin
> > > and ibeasy. Ibeasy and flamerobin show the same
> form, diferent from
> > > lazarus dataware componets.
connection charset is not mentioned which by default is '' which I don't
know how sqldb handle, but if you set UTF8 everything should be fine on
recent lazarus. Even in case when evey field specify a different charset.
> > >
> > > When i enter from flamerobin or ibeasy (via wine)
> the characters are
> > > showed normal in flamerobin and ibeasy but apear
> how squares with X
> > > (#225 i think) in lazarus dataware components.
> >
> > This is the same question as in the 'Unicode and
> DBAware' thread. The
> > strings in the database are stored in some local
> character set (probably
> > iso-8859-1) by Ibeasy and Flamerobin. But the latest
> Lazarus version
> > expect all strings to be in utf-8 encoding.
> >
> > So you have two options: store all data in the
> database using utf-8. If
> > Flamerobin and Ibeasy do not support utf-8, you could
> consider using
> > IBExpert, for example. (Windows only)
> >
> > Or you could convert all data read from the dataset
> from the encoding
> > used by Flamerobin and Ibeasy to the utf8-encoding.
> And offcourse, if
> > you store data into the database, you have to convert
> the data from
> > utf-8 to the other encoding. How you can do that you
> can find in my mail
> > in the DBAware-thread. Or you could use the OnGetText
> and OnSetText
> > properties from the TStringFields you are using.
Or as written above, use connection.charset :)
> >
> > I think it's obvious that if you have full control
> over the database,
> > the first option is the best one.
> >
> > There is a change that the second option will be
> automated in fpc 2.4.0
> > or 2.2.4, but that's hard to say now.
> >
> > And I think that, especially when Lazarus 0.9.26 is
> released, we'll get
> > this question very often. Maybe something to mention
> in the releasenotes
> > or the FAQ?
> >
> > Joost.
> >
Jesus Reyes A.
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ?gratis!
Reg?strate ya - http://correo.yahoo.com.mx/
_______________________________________________
Lazarus mailing list
http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080726/6097d4e1/attachment.html
