allow binary strings; avoid repeated calls to lookup encodings