We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello!
I encountered UnicodeDecodeError under Windows10; Japanese version.
I think there is a need to add encoding='UTF-8' when opening a SVG file at line 51 of utils.py.
UnicodeDecodeError Traceback (most recent call last) <ipython-input-20-f25891910720> in <module>() 6 class_names=['Safe', 'Bad']) 7 ----> 8 viz.view() c:\users\takahiro_endo\venv64\lib\site-packages\dtreeviz\trees.py in view(self) 64 tmp = tempfile.gettempdir() 65 svgfilename = f"{tmp}/DTreeViz_{getpid()}.svg" ---> 66 self.save(svgfilename) 67 view(svgfilename) 68 c:\users\takahiro_endo\venv64\lib\site-packages\dtreeviz\trees.py in save(self, filename) 101 with open(filename, encoding='UTF-8') as f: 102 svg = f.read() --> 103 svg = inline_svg_images(svg) 104 with open(filename, "w", encoding='UTF-8') as f: 105 f.write(svg) c:\users\takahiro_endo\venv64\lib\site-packages\dtreeviz\utils.py in inline_svg_images(svg) 50 svgfilename = img.attrib["{http://www.w3.org/1999/xlink}href"] 51 with open(svgfilename) as f: ---> 52 imgsvg = f.read() 53 imgroot = ET.fromstring(imgsvg) 54 for k,v in img.attrib.items(): # copy IMAGE tag attributes to svg from image file UnicodeDecodeError: 'cp932' codec can't decode byte 0x92 in position 1079: illegal multibyte sequence
The text was updated successfully, but these errors were encountered:
I just fix like with open(svgfilename,encoding='UTF-8') as f:
Sorry, something went wrong.
7d8efc4
No branches or pull requests
Hello!
I encountered UnicodeDecodeError under Windows10; Japanese version.
I think there is a need to add encoding='UTF-8' when opening a SVG file at line 51 of utils.py.
The text was updated successfully, but these errors were encountered: