Tell groff manpages are utf-8

This should fix the display of manpages with accents (mainly boobank).
This commit is contained in:
Laurent Bachelier 2013-03-09 12:52:18 +01:00
commit 89f4d7e905
33 changed files with 113 additions and 75 deletions

View file

@ -161,6 +161,7 @@ def analyze_application(app, script_name):
cmd_re = re.compile(r'^.+ Commands:$', re.MULTILINE)
helptext = re.sub(cmd_re, format_title, helptext)
helptext = helptext.replace("-", r"\-")
coding = r'.\" -*- coding: utf-8 -*-'
header = '.TH %s 1 "%s" "%s %s"' % (script_name.upper(), time.strftime("%d %B %Y"),
script_name, app.VERSION.replace('.', '\\&.'))
name = ".SH NAME\n%s \- %s" % (script_name, application.SHORT_DESCRIPTION)
@ -178,7 +179,7 @@ For full COPYRIGHT see COPYING file with weboob package.
# Skip internal applications.
footer += "\n\n.SH SEE ALSO\nHome page: http://weboob.org/applications/%s" % application.APPNAME
mantext = u"%s\n%s\n%s\n%s" % (header, name, helptext, footer)
mantext = u"%s\n%s\n%s\n%s\n%s" % (coding, header, name, helptext, footer)
with open(os.path.join(BASE_PATH, DEST_DIR, "%s.1" % script_name), 'w+') as manfile:
for line in mantext.split('\n'):
manfile.write('%s\n' % line.lstrip().encode('utf-8'))