More efficient string encoding.