base32 encoding and decoding that optimizes byte size based on input characters and supports unicode.