Subject: | Changes to Pod::Man with control named *roff characters |
I patched Man.pm v2.23 for to correct the output to nroff v1.18.1 with
utf8 activated.
Problem:
A .pod with "=encoding ut8" line, pod2man convert utf8 accented
characters ("á") into iso-8859-1 chars ("á"), and after this, into nroff
accented chars ("a\\*'"), but nroff v1.8.1 clear the accents, and only
show "a".
nroff recommend to use named control chars.
Not need to patch ToMan.pm with the '--utf8' switch to pod2man, because
groff v1.18.1 don't have utf8 support.
<http://rt.cpan.org/Public/Bug/Display.html?id=39000>
Also, I moved the conversion of %ESCAPE chars below the escape literal
quotes process.
362a363,368
Show quoted text
> # Normally we do character translation, but we won't even do that in
> # <Data> blocks or if UTF-8 output is desired.
> if ($convert && !$$self{utf8} && ASCII) {
> $text =~ s/([^\x00-\x7F])/$ESCAPES{ord ($1)} || "X"/eg;
> }
>
370,375d375
< # Normally we do character translation, but we won't even do that in
< # <Data> blocks or if UTF-8 output is desired.
< if ($convert && !$$self{utf8} && ASCII) {
< $text =~ s/([^\x00-\x7F])/$ESCAPES{ord ($1)} || "X"/eg;
< }
<
1310,1311c1310,1311
< "\\ ", "\\[r!]", "\\[ct]", "\\[Po]", "\\[Cs]", "\\[Ye]",
"\\[bb]", "\\[sc]", # 0xA0
< "\\[ad]", "\\[co]", "\\[Of]", "\\[Fo]", "\\[no]", "\\%",
"\\[rg]", "\\[a-]",
---
Show quoted text> "\\ ", undef, undef, undef, undef, undef, undef, undef,
> undef, undef, undef, undef, undef, "\\%", undef, undef,
1313,1314c1313,1314
< "\\[de]", "\\[+-]", "\\[S2]", "\\[S3]", "\\[aa]", "\\[mc]",
"\\[ps]", "\\[bu]", # 0xB0
< "\\[ac]", "\\[S1]", "\\[Om]", "\\[Fc]", "\\[14]", "\\[12]",
"\\[34]", "\\[r?]",
---
Show quoted text> undef, undef, undef, undef, undef, undef, undef, undef,
> undef, undef, undef, undef, undef, undef, undef, undef,
1316,1317c1316,1317
< "\\[`A]", "\\['A]", "\\[^A]", "\\[~A]", "\\[:A]", "\\[oA]",
"\\[AE]", "\\[,C]", # 0xC0
< "\\[`E]", "\\['E]", "\\[^E]", "\\[:E]", "\\[`I]", "\\['I]",
"\\[^I]", "\\[:I]",
---
Show quoted text> "A\\*`", "A\\*'", "A\\*^", "A\\*~", "A\\*:", "A\\*o", "\\*(AE",
"C\\*,",
Show quoted text> "E\\*`", "E\\*'", "E\\*^", "E\\*:", "I\\*`", "I\\*'", "I\\*^",
"I\\*:",
1319,1320c1319,1320
< "\\[-D]", "\\[~N]", "\\[`O]", "\\['O]", "\\[^O]", "\\[~O]",
"\\[:O]", "\\[mu]", # 0xD0
< "\\[/O]", "\\[`U]", "\\['U]", "\\[^U]", "\\[:U]", "\\['Y]",
"\\[TP]", "\\[ss]",
---
Show quoted text> "\\*(D-", "N\\*~", "O\\*`", "O\\*'", "O\\*^", "O\\*~", "O\\*:",
undef,
Show quoted text> "O\\*/", "U\\*`", "U\\*'", "U\\*^", "U\\*:", "Y\\*'", "\\*(Th",
"\\*8",
1322,1323c1322,1323
< "\\[`a]", "\\['a]", "\\[^a]", "\\[~a]", "\\[:a]", "\\[oa]",
"\\[ae]", "\\[,c]", # 0xE0
< "\\[`e]", "\\['e]", "\\[^e]", "\\[:e]", "\\[`i]", "\\['i]",
"\\[^i]", "\\[:i]",
---
Show quoted text> "a\\*`", "a\\*'", "a\\*^", "a\\*~", "a\\*:", "a\\*o", "\\*(ae",
"c\\*,",
Show quoted text> "e\\*`", "e\\*'", "e\\*^", "e\\*:", "i\\*`", "i\\*'", "i\\*^",
"i\\*:",
1325,1326c1325,1326
< "\\[Sd]", "\\[~n]", "\\[`o]", "\\['o]", "\\[^o]", "\\[~o]",
"\\[:o]", "\\[di]", # 0xF0
< "\\[/o]", "\\[`u]", "\\['u]", "\\[^u]", "\\[:u]", "\\['y]",
"\\[Tp]", "\\[:y]",
---
Show quoted text> "\\*(d-", "n\\*~", "o\\*`", "o\\*'", "o\\*^", "o\\*~", "o\\*:",
undef,
Show quoted text> "o\\*/" , "u\\*`", "u\\*'", "u\\*^", "u\\*:", "y\\*'", "\\*(th",
"y\\*:",
Now, nroff show correct utf8 accented chars.
Perl v5.10.0
Linux OpenSuSE v11.2 x86_64
GNU nroff (groff) version 1.18.1
LANG="es_ES.UTF-8"
LESS="-M -I -R"