PlantUML text encoding functions

v1.0.8 2020-10-01 08:56 UTC

This package is auto-updated.

Last update: 2021-09-29 01:51:16 UTC


This library exposes PlantUML text encoding functions:

  • encodep()
  • encode6bit()
  • append3bytes()
  • encode64()

ℹ️ Usually only encodep() is used.

Latest Stable Version Total Downloads License composer.lock .gitattributes Issues


PlantUML uses a special encoding to transform an uml text description like this:

Bob -> Alice : hello

into this:


The advantage of the last encoding is that it is easier to use in URL:



You must import encodep() function before using it:

require './vendor/autoload.php';

use function Jawira\PlantUml\encodep;

$encode = encodep('Alice -> Bob: hello');
echo "http://www.plantuml.com/plantuml/uml/{$encode}";

⚠️ Since v1.0.0, encodep() function expects to receive an UTF-8 string.

💡 Only PHP >=5.6 allows importing functions, for PHP <=5.5 you have to use full function's namespace.

More examples:


$ composer require jawira/plantuml-encoding


If you liked this project, ⭐ star it on GitHub.


These functions are a copy/paste from http://plantuml.com/code-php.

Packages from jawira

jawira/plantuml GitHub stars
Provides PlantUML executable and plantuml.jar
jawira/phing-open-task Gitlab stars
Phing task to open files, directories, and URLs with your favorite software.
jawira/case-converter GitHub stars
Convert strings between 13 naming conventions: Snake case, Camel case, Pascal case, Kebab case, Ada case, Train case, Cobol case, Macro case, Upper case, Lower case, Sentence case, Title case and Dot notation.
jawira/emoji-catalog GitHub stars
Get access to +3000 emojis as class constants.