Page 1 of 1

Character code page conversion

Posted: Fri Oct 31, 2014 11:06 am
by dmajkic
How does XFR perform character conversion via AddArray()and AddDbf()? Is it unicode based?
I have data in different formats (CP1250, CP852, CP1251), and I would like to display it.
I can use Harbour built in conversion od HB_TRANSLATE(), but I am not sure what target FRX codepage is.
What is the best way to do that?
--
Dusan Majkic
Wings Software

Character code page conversion

Posted: Fri Oct 31, 2014 11:43 am
by ignacio
dmajkic escribió el vie, 31 octubre 2014 11:06
How does XFR perform character conversion via AddArray()and AddDbf()? Is it unicode based?
I have data in different formats (CP1250, CP852, CP1251), and I would like to display it.
I can use Harbour built in conversion od HB_TRANSLATE(), but I am not sure what target FRX codepage is.
What is the best way to do that?
--
Dusan Majkic
Wings Software

Dear Sir,
I suggest you post that question on FR support forums. Maybe other FRX users can give you some clue on this. Sorry for not giving a better answer.
Regards,

Character code page conversion

Posted: Fri Oct 31, 2014 2:11 pm
by dmajkic
Quote:
I suggest you post that question on FR support forums

I have data in CP852 in DBF.
In delphi FastReport, which is unicode I do manual CP852-> UnicodeString (delphi internal unicode string type). Delphi FR Datasets work with UnicodeStrings, which are supplied, and that works Ok.
Spirin FR version uses Harbour internal conversion, which works automatic using. It uses older Delphi, which is not unicode, but uses Font.Charset. This works fine when _SET_CODEPAGE, and _SET_DBCODEPAGE are set.
Xailr FRX seems to ignore Font.Charset - this propbably means it is compiled with Unicode strings. But it is unclear how and when is translation from Habour string to Delphi unicode string performed.
So, how should I prepare string data for FRX? If Unicode is supported, how can I utilize it? Or does it respect HB translation support?
This very much Xailer FR related quiestin. Please advise.

Character code page conversion

Posted: Mon Nov 03, 2014 10:22 am
by ignacio
Hello,
We do not make any conversion. Strings are converted to Delphi basic String type. If you need any conversion you can do it your self on Harbour or FR side:
::oFastReport1:SetProperty( "Font", "Charset", 1 )
Regards

Character code page conversion

Posted: Mon Nov 03, 2014 11:27 am
by ignacio
ignacio escribió el lun, 03 noviembre 2014 10:22
Hello,
We do not make any conversion. Strings are converted to Delphi basic String type. If you need any conversion you can do it your self on Harbour or FR side:
::oFastReport1:SetProperty( "Font", "Charset", 1 )
Regards

BTW, I have just check that the code above did not work correctly. Is fixed and it will be available on next release.
In any case you can set the charset directly on the memo controls:
::oFastReport1:SetProperty( "Memo1", "Font.Charset", 1 )
Regards,

Character code page conversion

Posted: Mon Nov 03, 2014 1:19 pm
by dmajkic
Quote:
BTW, I have just check that the code above did not work correctly. Is fixed and it will be available on next release.
In any case you can set the charset directly on the memo controls:

If delphi used to compile FastReport in frx.dll is Unicode based, which is Delphi2009 and newer, than the delphi string type in FastReport is UnicodeString.
All Unicode edit controls ignore Font.Charset.
To make it work correctly with UnicpdeString it is necessary to perform conversion using Harbour C api, and convert from HB code page to UnicodeString. HB_TRANSLATE() does that on PRG level, so there must be equvivalent HB C API.
Thank you for prompt response.

Character code page conversion

Posted: Mon Nov 03, 2014 1:42 pm
by ignacio
dmajkic escribió el lun, 03 noviembre 2014 13:19
If delphi used to compile FastReport in frx.dll is Unicode based, which is Delphi2009 and newer, than the delphi string type in FastReport is UnicodeString.
All Unicode edit controls ignore Font.Charset.

FR after this change:
::oFastReport1:SetProperty( "Font", "Charset", SYMBOL_CHARSET )


dmajkic escribió el lun, 03 noviembre 2014 13:19

To make it work correctly with UnicpdeString it is necessary to perform conversion using Harbour C api, and convert from HB code page to UnicodeString. HB_TRANSLATE() does that on PRG level, so there must be equvivalent HB C API.


I believe that conversion is unnecessary.
Regards,


Attached files

Character code page conversion

Posted: Mon Nov 03, 2014 2:11 pm
by dmajkic
Quote:
FR after this change

Looks fine!
Is this version released?

Character code page conversion

Posted: Mon Nov 03, 2014 2:51 pm
by ignacio
dmajkic escribió el lun, 03 noviembre 2014 14:11
Quote:
FR after this change

Looks fine!
Is this version released?

Yes, the console libraries. Xailer libraries will be available on next Xailer realease.
Regards,
http://www.xailer.com/download?en&file=103

Character code page conversion

Posted: Fri Nov 07, 2014 8:40 am
by dmajkic
Just to confirm - it works fine.
Thank you!