Item13406: Directed graph plugin needs fixes for the unicode branch
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
The
DirectedGraphPlugin has two errors with the unicode branch.
- Foswiki dies with error
- doesn't render right the images (in some cases) - probably when the antialias is on.
Patch for the "die" error:
--- /tmp/DirectedGraphPlugin.pm 2015-05-15 22:57:10.000000000 +0200
+++ ./DirectedGraphPlugin.pm 2015-05-15 23:04:05.000000000 +0200
@@ -573,7 +573,7 @@
# as they are include in $attr.
my $hashCode =
- md5_hex( 'DOT'
+ md5_hex( map { $Foswiki::UNICODE ? Encode::encode('utf8', $_) : $_ } 'DOT'
. $desc
. $attr
. $antialias
The
md5_hex
doesn't like wide characters, e.g. when we are unicode -> encode...
Currently not investigated deeply the second error (wrong rendering), after the above patch the DGP
successfully renders most of
common graphs with unicode characters in the graph <dot> scripts, only some "special" cases are problematic.
--
JozefMojzis - 17 May 2015