Construct the image URI using the c# equivalent of Javascript Encode64(zip_deflate(s,9)) ?

0 votes
asked Jan 22, 2018 in To be sorted by Dan
I have easily ported the Encode64 from JS to c# ; Also, for simple use cases e.g "Alice -> Bob Hello",  the `System.IO.Compression.DeflateStream` from c# produces an URL that http://plantuml.com/image/encodedText... understands, however anything more complex the planuml.com returns an error.

How can I create the equivalent of somewhat proprietary Javascript Encode64(zip_deflate(s,9)) of Plantuml in c# code?

1 Answer

0 votes
answered Jan 22, 2018 by Serge Wenger Work (15,620 points)

Hello,

The full javascript example is http://plantuml.com/code-javascript-synchronous.

Are you sure that you do all operations in your c# code?

commented Jan 22, 2018 by Dan
Yes you are right I was having an error in the ported Encode64(..). My initial port was Encode64(string s) and for that I was encoding again the compressed byte array to UTF. The correct approach is to Encode64(byte[] barray) and everything will work smoothly.
commented Jan 23, 2018 by Serge Wenger Work (15,620 points)
Hello,
I'm happy that your code is running well. Your work could be usefulll for other users, so share it if possible.
...