diff options
author | W. Trevor King <wking@tremily.us> | 2014-02-14 08:48:54 -0800 |
---|---|---|
committer | David Bremner <david@tethera.net> | 2014-02-14 21:44:11 -0400 |
commit | ffed8f2866a567d52eebeca02d3c362de07efc9d (patch) | |
tree | 19c484b5a2fbcee1346890eaeed8a8bc52994374 /devel | |
parent | 0d563dae1d86f22b10981e99d69d0eb0b69a131d (diff) |
nmbug-status: Encode output using the user's locale
Instead of always writing UTF-8, allow the user to configure the
output encoding using their locale. This is useful for previewing
output in the terminal, for poor souls that don't use UTF-8 locales
;).
Diffstat (limited to 'devel')
-rwxr-xr-x | devel/nmbug/nmbug-status | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/devel/nmbug/nmbug-status b/devel/nmbug/nmbug-status index 018f1911..c4532f18 100755 --- a/devel/nmbug/nmbug-status +++ b/devel/nmbug/nmbug-status @@ -90,7 +90,7 @@ class Page (object): byte_stream = sys.stdout.buffer except AttributeError: # Python 2 byte_stream = sys.stdout - stream = codecs.getwriter(encoding='UTF-8')(stream=byte_stream) + stream = codecs.getwriter(encoding=_ENCODING)(stream=byte_stream) self._write_header(views=views, stream=stream) for view in views: self._write_view(database=database, view=view, stream=stream) @@ -249,7 +249,7 @@ _PAGES['html'] = HtmlPage( header='''<!DOCTYPE html> <html lang="en"> <head> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + <meta http-equiv="Content-Type" content="text/html; charset={encoding}" /> <title>Notmuch Patches</title> <style media="screen" type="text/css"> table {{ @@ -293,6 +293,7 @@ For more infomation see <a href="http://notmuchmail.org/nmbug">nmbug</a> </p> <h3>Views</h3> '''.format(date=datetime.datetime.utcnow().date(), + encoding=_ENCODING, inter_message_padding='0.25em', border_radius='0.5em'), footer='</body>\n</html>\n', |