作者mark038 (Mark)
看板Python
标题[问题] Draw graph 时node无法标中文的问题
时间Tue Apr 16 18:12:27 2013
大家好,
我安装pydot後 照下面的例子 可以产生图形 (node的名字为英文时)
http://pythonhaven.wordpress.com/2009/12/09/generating_graphs_with_pydot/
但我要改成中文就会出现以下讯息
pydot.InvocationException: Program terminated with status: 1.
stderr follows: Error: Invalid 2-byte UTF8 found in input.
Perhaps "-Gcharset=latin1" is needed?
我想应该是编码的问题 (我最怕面对的)
所以请问有无高手可以告诉我如何解决此问题 感谢!
我是用Python 2.7
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.128.102.37
1F:→ grapherd:试试看 u'中文' 或是 '中文'.decode('big5') 04/16 19:01
2F:→ grapherd:我这边中文可以正常出现 04/16 19:01