version 0.3.0: require singlebyte, support different encodings