utf-64

A terse, human-readable, URL-safe encoding for JSONish strings

What it does

UTF-64 is a way to encode any Unicode string so that it can safely be stored in a URL parameter, in a compact and readable way. This is useful any time you want to pass a JSON blob or Unicode string anywhere in a URL.

Compared to percent-encoding

Compared to Base64

  • Base64 isn't URL-safe (you need to use base64url instead).
  • Base64 has an awkward JS API for Unicode strings. UTF-64 has a convenient Unicode-aware API for multiple languages.

How to install

JavaScript / TypeScript

npm install utf64

Python

pip install utf64

Go

go get utf64.moreplease.com

Rust

cargo add utf64

Other languages

Contributions welcome! Please feel free to send a pull request or file an issue on GitHub.

About

UTF-64 is by Iain Merrick. It's free to use for any purpose. (See LICENSE on GitHub.)

More Please is my freelance software development business.