In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

Character code page conversion

FastReport for Xailer & [x]Harbour (English/Spanish)
Responder
dmajkic
Mensajes: 23
Registrado: Mié Sep 24, 2014 12:48 pm

Character code page conversion

Mensaje por 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
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Character code page conversion

Mensaje por ignacio »

dmajkic escribió el vie, 31 octubre 2014 11:06How 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,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
dmajkic
Mensajes: 23
Registrado: Mié Sep 24, 2014 12:48 pm

Character code page conversion

Mensaje por 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.
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Character code page conversion

Mensaje por 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
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Character code page conversion

Mensaje por ignacio »

ignacio escribió el lun, 03 noviembre 2014 10:22Hello,
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,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
dmajkic
Mensajes: 23
Registrado: Mié Sep 24, 2014 12:48 pm

Character code page conversion

Mensaje por 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.
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Character code page conversion

Mensaje por ignacio »

dmajkic escribió el lun, 03 noviembre 2014 13:19If 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
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
dmajkic
Mensajes: 23
Registrado: Mié Sep 24, 2014 12:48 pm

Character code page conversion

Mensaje por dmajkic »

Quote:FR after this change
Looks fine!
Is this version released?
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9246
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Character code page conversion

Mensaje por ignacio »

dmajkic escribió el lun, 03 noviembre 2014 14:11Quote: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
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
https://www.xailer.com
dmajkic
Mensajes: 23
Registrado: Mié Sep 24, 2014 12:48 pm

Character code page conversion

Mensaje por dmajkic »

Just to confirm - it works fine.
Thank you!
Responder