in reply to RTF::Writer hyphens removed

paragraph is expecting to be gives some rich text, yet you are passing it plain text. Use rtfesc to fix special characters such as "-".

use RTF::Writer qw( rtfesc ); $some_text = 'Hello this-is-a-hyphenated-sentence'; $rtf->paragraph( \'\fs24', rtfesc($some_text) ); $rtf->paragraph( \'\fs24\b', rtfesc("Anniversary-Date: $anniv_date"), \'\line' ); # or $rtf->paragraph( \'\fs24\b', rtfesc("Anniversary-Date: $anniv_date\n") );

Replies are listed 'Best First'.
Re^2: RTF::Writer hyphens removed
by inblosam (Monk) on Jul 07, 2005 at 01:53 UTC
    I tried the rtfesc and I get really weird characters in my RTF...

    With the text: 'It-has-some-dashes' it shows:

    It\_has\_some\_dashes\'2e

    I did just as explained above.


    Michael Jensen
      Sorry, I was sure I had figured it out -- I have no experience with the module or with RTF -- but it seems I was wrong.