The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

RTF::Encode

SYNOPSIS

    use RTF::Encode qw/ encode_rtf /;
    print encode_rtf("Smiling cat with heart shaped eyes, ".chr(0x1f63b);

encode_rtf

    my $rtf = encode_rtf($unicode);

This function takes a string, which may contain Unicode characters, and returns a string escaped to be used in an RTF file. It can be used to safely insert arbitrary text into a template RTF file, perhaps via Template.

\uN escaping is always used, even for characters less than 255, because the alternative, \'hh needs to know the current code page.

Line breaks are encoded as line breaks, \line, not as paragraphs.

\ucN is not generated, it does not appear to be necessary.

SPECIFICATION

http://www.biblioscape.com/rtf15_spec.htm

SEE ALSO

RTF::Writer

AUTHOR

Dave Lambley <dlambley@cpan.org>