Dear Isaac,
console.log(base32.decode(base32.encode("love"))); works as expected, it returns love, hooray.
But let's step aside the anglosaxonian world and type something in Cyrillic. For example, equivalent of word love is любовь in Russian, yet console.log(base32.decode(base32.encode("любовь"))); returns garbled piece of text ?OªµÏ \Õ?Uk¹²L.
Could you be so kind and make it working from the box without those additional helpers so users around the globe could enjoy your library without a hassle? Developer of Base91's implementation already did it.
Dear Isaac,
console.log(base32.decode(base32.encode("love")));
works as expected, it returnslove
, hooray.But let's step aside the anglosaxonian world and type something in Cyrillic. For example, equivalent of word
love
isлюбовь
in Russian, yetconsole.log(base32.decode(base32.encode("любовь")));
returns garbled piece of text?OªµÏ \Õ?Uk¹²L
.There are various intermediate solutions to this issue. I like the following two:
console.log(decodeURIComponent(escape(base32.decode(base32.encode(unescape(encodeURIComponent("любовь")))))));
returnsлюбовь
console.log(UTF8.decode(base32.decode(base32.encode(UTF8.encode("любовь")))));
returnsлюбовь
Also, there's Encoding API.
Could you be so kind and make it working from the box without those additional helpers so users around the globe could enjoy your library without a hassle? Developer of Base91's implementation already did it.