See https://github.com/samthor/fast-text-encoding.