@Potherca gives a good answer. But I think you'd invoke plantuml.jar from n8n? Then you don't need any of the implementations in a different language, this is a key sentence:
> You can use -encodeurl or -decodeurl in the command line flags to encode or decode the text.
If you will link to plantuml as a library, then you should find the Java method that encodes.