Search code examples
javascriptjquerycharacter-encodingascii85base85

how to encode/decode ascii85 in javascript


I was looking for an alternative to Base64 which works fine on Unicode characters. I have found ASCII85 which works great however I found no code or command doing that in JS.

I just found this link which does not work for international characters and does not include decode function.

Here there are online Decoder/Encoder.

Even found codes in C language doing that(I don't have enough JS data handling knowledge to convert).

And some codes that I don't know how to run.

I have heard that JQuery does support Base64 but it seems that it does not support Ascii85.

Does somebody know anything about Ascii85 in JS which might help?

thanks


Solution

  • using dojo.js framework :

    Decode Example + source

    Encode Example + source

    ascii85 Encoding using

    summary:

    dojo.require("dojox.encoding.ascii85");
    var dc = dojox.encoding
    var buf = dc.ascii85.decode("")
    var a85 = dc.ascii85.encode("");