Encoding with SaveToFile

  • Hello,

    I have a problem the SaveToFile method of TWPRichText in WPTools8.

    Sometime the RTF is save in UTF-8 and sometime in ANSI, but LoadFromFile seems to always look for ANSI creating problems with the OnMailMergeGetText Event.

    When the document is save in ANSI inspname get the expected value (L"Général.var").

    But when it is save in UTF-8 it become (L"G�n�ral.Var") causing me to fail the merging.

    I have try to use the "-codepage" option in the FormatName but it seems to be ignored even if available with RTF (https://www.wpcubed.com/manuals/formatstrings.htm).

    Option which sems to be ANSI if not specified (1252).

    Do you have an other way to force the RTF to be save in ANSI?

    • Offizieller Beitrag

    Saving of the merge fields has been optimized in WPTools 8. Which compiler do you use?

    The code should write non ASCII characters in fields not as UTF9 but as unicodes uXXXX. So I would need more information on where you see the UTF8 encoding.