RTF::Encode
use RTF::Encode qw/ encode_rtf /; print encode_rtf("Smiling cat with heart shaped eyes, ".chr(0x1f63b);
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.
\uN
\'hh
Line breaks are encoded as line breaks, \line, not as paragraphs.
\line
\ucN is not generated, it does not appear to be necessary.
\ucN
http://www.biblioscape.com/rtf15_spec.htm
Dave Lambley <dlambley@cpan.org>
To install RTF::Encode, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RTF::Encode
CPAN shell
perl -MCPAN -e shell install RTF::Encode
For more information on module installation, please visit the detailed CPAN module installation guide.