Home Devices

wrong caracter in text file export

edited February 2017 in Devices
hi,
using Delphi berlin 10.1 & RB 17.03
when i print as text file , the "?" caracter print as "??"
This causes an offset in the file

regards
julien bertano

Comments

  • edited February 2017
    Hi Julien,

    For Unicode versions of Delphi, all text is exported with UTF8 encoding.
    Most text readers such as Notepad can detect UTF8 text without a byte
    order mark (BOM) added which is why we do not add it by default.

    It may be necessary for you to add the BOM to your exported output to
    get the correct text. To do so, you can simply set the
    TextFileDevice.IncludeBOM property to True after the device has been
    created. The Report.OnFileDeviceCreate event is a good place to do this.

    procedure TForm1.ppReport1FileDeviceCreate(Sender: TObject);
    begin

    if (Report.FileDevice is TppTextFileDevice) then
    TppTextFileDevce(Report.FileDevice).IncludeBOM := True;

    end;

    --
    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited November 2017
    Thank you Nico !

    (I did not thank you)

This discussion has been closed.