-Fixed issue 52. Improved handling of BOM-less UTF-8 encoded files.

git-svn-id: http://pydot.googlecode.com/svn/trunk@28 06aa9b79-7134-0410-ae7e-c1cd3e483e87
This commit is contained in:
Ero Carrera 2012-01-02 23:24:38 +00:00
parent 9999c00c26
commit 9875c08935
1 changed files with 3 additions and 5 deletions

View File

@ -505,11 +505,9 @@ def parse_dot_data(data):
global top_graphs
top_graphs = list()
if data.startswith( codecs.BOM_UTF8 ):
data = data.decode( 'utf-8' ).lstrip( unicode(codecs.BOM_UTF8, "utf8") )
data = data.encode( 'ascii' )
if data.startswith(codecs.BOM_UTF8):
data = data.decode( 'utf-8' )
try: