Permalink
Browse files

String.getBytes() in btree did not specify default charset. Force UTF8

  • Loading branch information...
1 parent 6b2d997 commit fe76548a2a9e9604e5ce5c1856b164d4714545e2 @jankotek committed Aug 21, 2012
@@ -1100,7 +1100,7 @@ private void writeValues(DataOutput oos, BTreeNode<K, V> node) throws IOExceptio
for (int i = firstUse; i < BTree.DEFAULT_SIZE; i++) {
byte[] b = leadingValuePackRead(ois, previous, 0);
if (b == null) continue;
- ret[i] = new String(b);
+ ret[i] = new String(b,Serialization.UTF8);
previous = b;
}
return (K[]) ret;
@@ -1246,7 +1246,7 @@ private void writeKeys(DataOutput oos, K[] keys, final int firstUse) throws IOEx
if (keys[i] == null) {
leadingValuePackWrite(oos, null, previous, 0);
} else {
- byte[] b = ((String) keys[i]).getBytes();
+ byte[] b = ((String) keys[i]).getBytes(Serialization.UTF8);
leadingValuePackWrite(oos, b, previous, 0);
previous = b;
}
@@ -47,7 +47,7 @@
static final boolean DEBUG = false;
- private static final String UTF8 = "UTF-8";
+ static final String UTF8 = "UTF-8";
Serialization(DBAbstract db, long serialClassInfoRecid, ArrayList<ClassInfo> info) throws IOException {
super(db, serialClassInfoRecid,info);

0 comments on commit fe76548

Please sign in to comment.