diff options
Diffstat (limited to 'mitmproxy/contentviews.py')
| -rw-r--r-- | mitmproxy/contentviews.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/mitmproxy/contentviews.py b/mitmproxy/contentviews.py index 304b5241..dacef36d 100644 --- a/mitmproxy/contentviews.py +++ b/mitmproxy/contentviews.py @@ -262,7 +262,7 @@ class ViewHTMLOutline(View): content_types = ["text/html"] def __call__(self, data, **metadata): - data = data.decode("utf-8") + data = data.decode("utf-8", "replace") h = html2text.HTML2Text(baseurl="") h.ignore_images = True h.body_width = 0 @@ -389,7 +389,8 @@ class ViewJavaScript(View): def __call__(self, data, **metadata): opts = jsbeautifier.default_options() opts.indent_size = 2 - res = jsbeautifier.beautify(strutils.native(data), opts) + data = data.decode("utf-8", "replace") + res = jsbeautifier.beautify(data, opts) return "JavaScript", format_text(res) |
