Graphviz does not support UTF-8 encoding

I created a file dot.which contains some Korean language in some node shortcut .i created a png file using the graphvig tool, but the created png does not support the Korean language, it looks like a square. if i create svg file then it works fine. help me how to resolve this.

+6
source share
5 answers

Also try running dot -v to find out which plugins and font files are loading. As a rule, we expect UTF-8 to work (it worked a lot for many years), and the text layout through the cairopango driver works well. The downside is that pango now does its own font search, which is part of the black box for other code. (pango recently reset fontconfig, which is understandable. We never found a way to determine if fontconfig could not find a good match for this specification - it would have fun to return, such as a typewriter font, when it could not find another match.) I hope this a little help. Stephen North (for the graphviz project)

+5
source

I had the same problem when the .png file was created, non-ascii characters are not displayed correctly.

My alternative solution is to use the .svg output (via some command like: dot -Tsvg my_graph.gv ), which left the problem of finding fonts in the svg viewer.

You can open a .svg file using a web browser. Most web browsers also support the save as function to convert the .svg file to .png if you insist on the .png format.

Hope this is helpful

+3
source

Use the tool to convert the SVG file to PNG. I suggest Batik . Of course, you have to deal with installing fonts. Alternatively, you can use Inkscape , although this is a bit more of a manual process.

0
source

Make sure korean fontname is set on your chart.

0
source

I ran into the same problem and the following lines helped me:

 strict digraph { node [ fontname="Adobe Kaiti Std" ]; edge [ fontname="Adobe Heiti Std" ]; } 
0
source

All Articles