Explicitly convert a (lazy) ByteString to a Text value using UTF-8 encoding, throwing a GraphvizException if there is a decoding error.
Modulegraphviz-2999.20.2.0Haskell2010
Data.GraphViz.Commands.IO
Various utility functions to help with custom I/O of Dot code.
- 10 values
- Packagegraphviz-2999.20.2.0
- Exports10
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceIO.hs
Encoding
1 declarationBy default, Dot code should be in UTF-8. However, by usage of the charset attribute, users are able to specify that the ISO-8859-1 (aka Latin1) encoding should be used instead: http://www.graphviz.org/doc/info/attrs.html#d:charset
To simplify matters, graphviz does not work with ISO-8859-1. If you wish to deal with existing Dot code that uses this encoding, you will need to manually read that file in to a Text value.
If a non-UTF-8 encoding is used, then a GraphvizException will be thrown.
Operations on files
2 declarationsWrite the specified DotRepr to file.
Read in and parse a DotRepr value from a file.
Operations on handles
4 declarationsOutput the DotRepr to the specified Handle.
Output the DotRepr to the spcified Handle in a more compact,
machine-oriented form.
Read in and parse a DotRepr value from the specified Handle.
Strictly read in a Text value using an appropriate encoding.
Special cases for standard input and output
2 declarationsPrint the specified DotRepr to stdout.
Read in and parse a DotRepr value from stdin.
Running external commands
1 declarationrunCommand Run an external command on the specified DotRepr. Remember to
use hSetBinaryMode on the Handle for the output function if
necessary.
If the command was unsuccessful, then a GraphvizException is thrown.
For performance reasons, a temporary file is used to store the generated Dot code. As such, this is only suitable for local commands.