1654 |
* in the path. |
* in the path. |
1655 |
*/ |
*/ |
1656 |
if (!troff) { |
if (!troff) { |
1657 |
const char *source_encoding, *roff_encoding; |
const char *page_encoding, *source_encoding, |
1658 |
|
*roff_encoding; |
1659 |
const char *cat_charset; |
const char *cat_charset; |
1660 |
|
|
1661 |
#define STRC(s, otherwise) ((s) ? (s) : (otherwise)) |
#define STRC(s, otherwise) ((s) ? (s) : (otherwise)) |
1662 |
|
|
1663 |
|
page_encoding = get_page_encoding (lang); |
1664 |
source_encoding = get_source_encoding (lang); |
source_encoding = get_source_encoding (lang); |
1665 |
if (debug) |
if (debug) { |
1666 |
|
fprintf (stderr, "page_encoding = %s\n", |
1667 |
|
page_encoding); |
1668 |
fprintf (stderr, "source_encoding = %s\n", |
fprintf (stderr, "source_encoding = %s\n", |
1669 |
source_encoding); |
source_encoding); |
1670 |
|
} |
1671 |
|
|
1672 |
cat_charset = get_standard_output_encoding (lang); |
cat_charset = get_standard_output_encoding (lang); |
1673 |
locale_charset = get_locale_charset (); |
locale_charset = get_locale_charset (); |
1700 |
STRC (roff_device, "NULL")); |
STRC (roff_device, "NULL")); |
1701 |
} |
} |
1702 |
|
|
1703 |
roff_encoding = get_roff_encoding (roff_device); |
roff_encoding = get_roff_encoding (roff_device, |
1704 |
|
source_encoding); |
1705 |
if (debug) |
if (debug) |
1706 |
fprintf (stderr, "roff_encoding = %s\n", |
fprintf (stderr, "roff_encoding = %s\n", |
1707 |
STRC (roff_encoding, "NULL")); |
roff_encoding); |
1708 |
|
|
1709 |
/* We may need to recode: |
/* We may need to recode: |
1710 |
* from source_encoding to roff_encoding on input; |
* from page_encoding to roff_encoding on input; |
1711 |
* from output_encoding to locale_charset on output. |
* from output_encoding to locale_charset on output. |
1712 |
*/ |
*/ |
1713 |
if (roff_encoding && |
if (roff_encoding && |
1714 |
!STREQ (source_encoding, roff_encoding)) |
!STREQ (page_encoding, roff_encoding)) |
1715 |
command = strappend (command, |
command = strappend (command, |
1716 |
" | iconv -c -f ", |
" | iconv -c -f ", |
1717 |
source_encoding, " -t ", |
page_encoding, " -t ", |
1718 |
roff_encoding, NULL); |
roff_encoding, NULL); |
1719 |
|
|
1720 |
output_encoding = get_output_encoding (roff_device); |
output_encoding = get_output_encoding (roff_device); |