From 88ec2b989b9e7c8ccef5d9c3aa2800758c24e7f5 Mon Sep 17 00:00:00 2001 From: Aaron Ji Date: Tue, 9 May 2023 14:28:58 +0800 Subject: [PATCH] fix plantuml server url encode --- plantuml-mode.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plantuml-mode.el b/plantuml-mode.el index e40ba0d..4f89920 100644 --- a/plantuml-mode.el +++ b/plantuml-mode.el @@ -426,8 +426,9 @@ Put the result into buffer BUF. Window is selected according to PREFIX: "Encode the string STRING into a URL suitable for PlantUML server interactions." (let* ((coding-system (or buffer-file-coding-system "utf8")) - (encoded-string (base64-encode-string (encode-coding-string string coding-system) t))) - (concat plantuml-server-url "/" plantuml-output-type "/-base64-" encoded-string))) + (str (encode-coding-string string coding-system)) + (encoded-string (mapconcat (lambda(x)(format "%02X" x)) str ) )) + (concat plantuml-server-url "/" plantuml-output-type "/~h" encoded-string))) (defun plantuml-server-preview-string (prefix string buf) "Preview the diagram from STRING as rendered by the PlantUML server.