--- roffit	2020-04-26 22:17:06.941530532 +0200
+++ roffit.fixed	2020-04-29 19:54:53.974455455 +0200
@@ -16,7 +16,18 @@
 #use warnings;
 use HTML::Entities qw(encode_entities);
 sub do_encode($) {
-    return encode_entities(shift, q{<>&"'#});
+    my $text = encode_entities(shift, q{<>&"'#});
+    $text =~ s/\\\(aq/&apos\;/g;
+    # \*(Aq is sometimes used as workaround to enable copy/paste for single
+    # quotes from man pages depending on roff variant and version
+    $text =~ s/\\\*\(Aq/&apos\;/g;
+    $text =~ s/\\\(oq/&lsquo\;/g;
+    $text =~ s/\\\(cq/&rsquo\;/g;
+    $text =~ s/\\\(dq/&quot\;/g;
+    $text =~ s/\\\(lq/&ldquo\;/g;
+    $text =~ s/\\\(rq/&rdquo\;/g;
+    $text =~ s/\\\(ti/&#126\;/g;
+    return $text;
 }
 
 my $InFH = \*STDIN;
