monotone-commits-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-commits-diffs] net.venge.monotone: 40ca0bb7367dc73f024da6ded6


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone: 40ca0bb7367dc73f024da6ded659be69cfac1144
Date: Tue, 22 Mar 2011 14:24:53 +0100 (CET)

revision:            40ca0bb7367dc73f024da6ded659be69cfac1144
date:                2011-03-22T13:24:34
author:              Richard Levitte <address@hidden>
branch:              net.venge.monotone
changelog:
* src/std_hooks.lua (get_man_page_formatter_command): Set the environment
  variable GROFF_ENCODING before calling nroff.  This is a transparent
  way to tell groff how to treat the input, should that be the underlying
  program nroff uses.  For those that don't use groff, this doesn't solve
  anything, but doesn't harm either.  Patches are welcome to solve the
  issue for other systems as well.
  Issue: 154: Localized output of mtn manpage leads to corrputed characters

manifest:
format_version "1"

new_manifest [83d25b43462a5a43e5a44ba2a071d04588232cfe]

old_revision [e3e76081b2bcd0a990ad0ee09fea7a7fc60bf7c2]

patch "src/std_hooks.lua"
 from [30949d110cc1ed86d98f4f437fda16778a3e85bb]
   to [ada658bd275399032411e0f520d9900bad966dc4]
============================================================
--- src/std_hooks.lua	30949d110cc1ed86d98f4f437fda16778a3e85bb
+++ src/std_hooks.lua	ada658bd275399032411e0f520d9900bad966dc4
@@ -1523,12 +1523,20 @@ function get_man_page_formatter_command(
    --
    -- On MinGW, 'popen' runs 'cmd.exe' with the inherited path. MinGW
    -- does not (currently) provide nroff or equivalent. So we assume
-   -- sh, nroff and less are also installed, from Cygwin or some other
-   -- toolset.
+   -- sh, nroff, locale and less are also installed, from Cygwin or
+   -- some other toolset.
+   --
+   -- GROFF_ENCODING is an environment variable that, when set, tells
+   -- groff (called by nroff where applicable) to use preconv to convert
+   -- the input from the given encoding to something groff understands.
+   -- For example, groff doesn NOT understand raw UTF-8 as input, but
+   -- it does understand unicode, which preconv will happily provide.
+   -- This doesn't help people that don't use groff, unfortunately.
+   -- Patches are welcome!
    if string.sub(get_ostype(), 1, 7) == "Windows" then
-      return string.format("sh -c 'nroff -man -rLL=%dn' | less -R", term_width)
+      return string.format("sh -c 'GROFF_ENCODING=`locale charmap` nroff -man -rLL=%dn' | less -R", term_width)
    else
-      return string.format("nroff -man -rLL=%dn | less -R", term_width)
+      return string.format("GROFF_ENCODING=`locale charmap` nroff -man -rLL=%dn | less -R", term_width)
    end
 end
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]