title: Convert Outlook htmlrtf to html in perl
body: <p>I managed to extract the RTF part from an Outlook .msg using <code>Email::Outlook::Message</code>. Here's how it looks:</p>
  <pre><code>{\*\htmltag84 &lt;b&gt;}\htmlrtf {\b \htmlrtf0
  {\*\htmltag148 &lt;span lang=&quot;EN-US&quot; style=&quot;font-size:12.0pt;color:#002060;mso-fareast-language:EN-IN&quot;&gt;}\htmlrtf {\lang1033 \htmlrtf0 FooBar
  {\*\htmltag156 &lt;/span&gt;}\htmlrtf }\htmlrtf0 
  {\*\htmltag92 &lt;/b&gt;}\htmlrtf }\htmlrtf0
  </code></pre>
  <p>When Outlooks sends an Internet Mail it converts the RTF to text/html:</p>
  <pre><code>&lt;b&gt;&lt;span style=&quot;font-size:12.0pt;color:#002060;mso-fareast-language:EN-IN&quot;&gt;FooBar&lt;/span&gt;&lt;/b&gt;
  </code></pre>
  <p>I'm trying to do the same using <a href="https://metacpan.org/pod/RTF::HTML::Converter" rel="nofollow noreferrer">RTF::HTML::Converter</a>, but it strips all styling:</p>
  <pre><code>&lt;b&gt;FooBar&lt;/b&gt;
  </code></pre>
  <p>Here's the script:</p>
  <pre><code>use strict;
  use RTF::HTML::Converter;
  my $object = RTF::HTML::Converter-&gt;new(
          output =&gt; \*STDOUT
  );
  local *RTF_FILE;
  open RTF_FILE, &quot;$ARGV[0]&quot; or die $!;
  $object-&gt;parse_stream( \*RTF_FILE );
  </code></pre>
  <p>I also tried the <a href="https://linux.die.net/man/1/unrtf" rel="nofollow noreferrer">unrtf</a> tool. It also strips the styles:</p>
  <pre><code>&lt;font face=&quot;Arial&quot;&gt;&lt;font size=&quot;3&quot;&gt;&lt;b&gt;FooBar&lt;/b&gt;&lt;/font&gt;&lt;/font&gt;
  </code></pre>