From d77999a6db7de93baedb7efe9026214b9bc215c4 Mon Sep 17 00:00:00 2001 From: Egmont Koblinger Date: Tue, 2 Sep 2014 14:31:15 +0300 Subject: [PATCH] Ticket #1539: Dealing with utf-8 man pages in view/open Weird characters are displayed when viewing/opening man page files. Signed-off-by: Slava Zanko --- misc/ext.d/text.sh.in | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/misc/ext.d/text.sh.in b/misc/ext.d/text.sh.in index 99c8beed9..858a9cb00 100644 --- a/misc/ext.d/text.sh.in +++ b/misc/ext.d/text.sh.in @@ -45,7 +45,7 @@ do_view_action() { cat "${MC_EXT_FILENAME}" ;; *) - { zsoelim "${MC_EXT_FILENAME}" 2>/dev/null || cat "${MC_EXT_FILENAME}"; } | nroff @MAN_FLAGS@ @MANDOC@ + MANROFFOPT=-c MAN_KEEP_FORMATTING=1 man -P cat -l "${MC_EXT_FILENAME}" ;; esac ;; @@ -64,7 +64,9 @@ do_view_action() { ${unpacker} "${MC_EXT_FILENAME}" ;; *) - ${unpacker} "${MC_EXT_FILENAME}" | nroff @MAN_FLAGS@ @MANDOC@ + # "man" takes care of uncompressing. + # This way the stdin is left intact so the correct width is used. + MANROFFOPT=-c MAN_KEEP_FORMATTING=1 man -P cat -l "${MC_EXT_FILENAME}" ;; esac ;;