diff --git a/IPython/nbconvert/filters/strings.py b/IPython/nbconvert/filters/strings.py index 4b8d78f..36d8b4b 100755 --- a/IPython/nbconvert/filters/strings.py +++ b/IPython/nbconvert/filters/strings.py @@ -80,7 +80,7 @@ def add_anchor(html): For use in heading cells """ - h = ElementTree.fromstring(py3compat.cast_bytes_py2(html)) + h = ElementTree.fromstring(py3compat.cast_bytes_py2(html, encoding='utf-8')) link = html2text(h).replace(' ', '-') h.set('id', link) a = ElementTree.Element("a", {"class" : "anchor-link", "href" : "#" + link})