diff options
author | Sylvain <syt@logilab.fr> | 2007-08-22 16:15:07 +0200 |
---|---|---|
committer | Sylvain <syt@logilab.fr> | 2007-08-22 16:15:07 +0200 |
commit | dac0e1b119afe6bb24e8de05ec886049d99d8b43 (patch) | |
tree | 567b02ea091d6208f2dfb061eeaaa2e860f9b4cc /graph.py | |
parent | 003e937d1d05c0ee003fd0e80e865fc001df305c (diff) | |
download | logilab-common-dac0e1b119afe6bb24e8de05ec886049d99d8b43.tar.gz |
explicit charset declaration in the dot file
Diffstat (limited to 'graph.py')
-rw-r--r-- | graph.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -30,7 +30,7 @@ def target_info_from_filename(filename): class DotBackend: """Dot File backend""" - def __init__(self, graphname, rankdir=None, size=None, ratio=None): + def __init__(self, graphname, rankdir=None, size=None, ratio=None, charset='utf-8'): self.graphname = graphname self.lines = [] self._source = None @@ -41,6 +41,10 @@ class DotBackend: self.emit('ratio=%s' % ratio) if size: self.emit('size="%s"' % size) + if charset: + assert charset.lower() in ('utf-8', 'iso-8859-1', 'latin1'), \ + 'unsupported charset %s' % charset + self.emit('charset="%s"' % charset) def get_source(self): """returns self._source""" |