Specify input and output encodings for tidylib explicitly.
authorAdam Sampson <ats@offog.org>
Mon, 3 Oct 2016 21:38:36 +0000 (22:38 +0100)
committerAdam Sampson <ats@offog.org>
Mon, 3 Oct 2016 21:38:36 +0000 (22:38 +0100)
tidylib 5 -- which Debian now packages -- has changed the default, and
this caused the test suite to break in a recent rebuild (bug #839294).

NEWS
rawdoglib/rawdog.py

diff --git a/NEWS b/NEWS
index b3983464ffdcb213fd38cd31770aa9e043691ea2..34919938910f806f37ae6f462af5e02b84af6db2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,11 @@ those cases rawdog shouldn't update the URL in the config file.
 
 Fix some more style problems reported by pylint.
 
+Specify the input and output character encodings for pytidylib
+explicitly. tidylib 5 has changed the defaults from ASCII to UTF-8;
+rawdog relies on it being ASCII in order to generate ASCII output
+(reported by Lucas Nussbaum).
+
 - rawdog 2.21
 
 Don't crash when asked to show a non-existant template ("-s foo") -- and
index d1d4e4c3434d2eb7847c3407efeeb0ca3256414d..8a6702abea96377dd9abe01ca34c8c27a764170b 100644 (file)
@@ -136,6 +136,8 @@ def sanitise_html(html, baseurl, inline, config):
        if config["tidyhtml"]:
                args = {
                        "numeric_entities": 1,
+                       "input_encoding": "ascii",
+                       "output_encoding": "ascii",
                        "output_html": 1,
                        "output_xhtml": 0,
                        "output_xml": 0,