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

JoshyFun joshyfun at gmail.com
Fri Sep 12 13:22:14 CEST 2008


Hello ABorka,

Friday, September 12, 2008, 2:30:35 AM, you wrote:

A> Thanks for pointing me to the Lazarus thread about this and the bug
A> report. Checked them.
A> But as I understand there is no solution available at the moment for this.

I had partially solved the problem using the handler "OnGetText" ?
(I'm not sure about the name) for each field which is somehow dirty
forcing a codepage to UTF8 conversion (in Lazarus you will find some
codepage<->UTF conversions available).

A> I have a database that is not encoded utf8 (and it will never be because
A> other client programs are accessing it and their users do not want/need
A> to be converted to unicode). How do I get the field values into 
A> FPC/Lazarus into a string variable? Right now the non-unicode strings
A> are returned as empty from a database field due to FCL conversion functions.

If you will need this as a fixed solution for this project maybe you
can think in create a new database unit file based in the current one
(change the name of course) with hardcoded UTF8 encoding from codepage
for each string once retrieved from the database. Take care about
string length as UTF8 ones will be equal or longer than the original
ones.

A> Not to mention writing something to the database back.
A> Is there a function to convert 'My Perfect™ World®' to whatever format
A> the components require and vice versa? Something for the ASCII table up
A> till #255 (English letters with some special characters like the above
A> example).

Check lconvencoding.pas in the LCL folder of Lazarus.

-- 
Best regards,
 JoshyFun




More information about the fpc-devel mailing list