[Lazarus] Firebirdsql Characters Compatibility

JoshyFun joshyfun at gmail.com
Fri Jul 25 19:30:19 CEST 2008


Hello Osvaldo,

Friday, July 25, 2008, 6:21:21 PM, you wrote:

OT> Pearhaps the problem is in the way of componet get/send data from
OT> database. Not in lazarus.
OT> FirebirdSQL save data as is receved from the client, it use de charset
OT> and the collate for this.
OT> When i create a field with utf8 charset i see correct in all clients
OT> with support utf8: lazarus (use utf8, ever)  and flamerobin (use defined
OT> charset).
OT> The problem is how lazarus send/get data respecting the charset of
OT> component connection. 
OT> Dataset.dataconvert? transliterate? more ideia?

I'm now using the "AfterOpen" of each TSQLQuery which based in the
DEFINE of unicode support, calls a function that hooks the
OnGetText/OnSetText of each ftString field. The hook on these
functions calls UTF8Encode and UTF8Decode.

In my code this seens to be the more clean way to keep the ISO8859-1
data and UTF8 representation. When upgrade database simple replace the
hook function by a dummy one and "voila" ready.

If you already uses the OnGetText/OnSetText in your code this solution
will overcomplicate it :(

-- 
Best regards,
 JoshyFun




More information about the Lazarus mailing list