diff src/com/tmate/hgkit/ll/HgDirstate.java @ 11:d46773d89a19

Boundary error in dirstate entry, explicit encoding to face troubles (if any) asap.
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Sat, 25 Dec 2010 22:19:31 +0100
parents 382cfe9463db
children 181fccc176ef
line wrap: on
line diff
--- a/src/com/tmate/hgkit/ll/HgDirstate.java	Sat Dec 25 21:50:12 2010 +0100
+++ b/src/com/tmate/hgkit/ll/HgDirstate.java	Sat Dec 25 22:19:31 2010 +0100
@@ -62,8 +62,8 @@
 				da.readBytes(name, 0, nameLen);
 				for (int i = 0; i < nameLen; i++) {
 					if (name[i] == 0) {
-						fn1 = new String(name, 0, i);
-						fn2 = new String(name, i+1, nameLen);
+						fn1 = new String(name, 0, i, "UTF-8"); // XXX unclear from documentation what encoding is used there
+						fn2 = new String(name, i+1, nameLen - i - 1, "UTF-8"); // need to check with different system codepages
 						break;
 					}
 				}