Change char key encoding scheme
now char is encoded as unsigned int
char   -> RLP string
0x00ff -> 0x81ff     (was: 0x8200ff)
0xffff -> 0x82ffff   (was: 0x8300ffff)
@@ -13,6 +13,7 @@ import s.java.lang.Character;
import p.avm.Address;
import java.math.BigInteger;
+import java.util.Arrays;
public class RLPCoder {
private ByteArrayOutputStream bos;
@@ -70,6 +71,8 @@ public class RLPCoder {
} else if (v instanceof Character) {
var vv = ((Character) v).getUnderlying();
var bs = BigInteger.valueOf(vv).toByteArray();
+ if (bs.length>1 && bs[0]==0)
+ bs = Arrays.copyOfRange(bs, 1, bs.length);
encode(bs);
} else {
throw new InvalidDBAccessException("bad key type :" + v.getClass());
