core: support more encodings