作者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
→ grapherd:試試看 u'中文' 或是 '中文'.decode('big5') 04/16 19:01
→ grapherd:我這邊中文可以正常出現 04/16 19:01