PlantUML Text Encoding
PlantUML defines a standardized way to encode diagram text description to a simple string of characters that contains only digits, letters, underscore and minus character.
The goal of such an encoding is to facilitate communication of diagrams through URL (see server).
This encoding includes compression to keep encoded strings as short as possible.
The encoded metadata is stored in the generated PNG, so the diagram source can be extracted from the diagram itself! (see server#metadata).
|
🎉 Copied!
|
![]() |
is compressed to 428-char string length using Deflate
-encodeurl
or -decodeurl
in the command line flags to encode or decode the text.
You will find here some implementation of this encoder:
@startuml
Alice->Bob : I am using hex
@enduml
will be turned into:
407374617274756d6c0a416c6963652d3e426f62203a204920616d207573696e67206865780a40656e64756d6c
To indicate the use of HEX format, you must add
~h
at the start of the data sent to PlantUML server.
http://www.plantuml.com/plantuml/uml/~h4073...
Since there is no compression here, the URL will become very long as the diagram grows.