summaryrefslogtreecommitdiffstats
path: root/src/com/gitblit/utils/JGitUtils.java
diff options
context:
space:
mode:
authorJames Moger <james.moger@gitblit.com>2011-04-27 20:55:38 -0400
committerJames Moger <james.moger@gitblit.com>2011-04-27 20:55:38 -0400
commit3e087ada55f8b0e83b146578b695552db9dc8d97 (patch)
tree69b5b78421848011b95ff52527f4cf950e6d51d4 /src/com/gitblit/utils/JGitUtils.java
parentc1c3c6a7a2f0a2893ef36ab3dfc7b09d04a133bc (diff)
downloadgitblit-3e087ada55f8b0e83b146578b695552db9dc8d97.tar.gz
gitblit-3e087ada55f8b0e83b146578b695552db9dc8d97.zip
Integrated pagelinks into RepositoryPage. Fixed string encoding.
Diffstat (limited to 'src/com/gitblit/utils/JGitUtils.java')
-rw-r--r--src/com/gitblit/utils/JGitUtils.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java
index e5dbfd2d..8814c1f4 100644
--- a/src/com/gitblit/utils/JGitUtils.java
+++ b/src/com/gitblit/utils/JGitUtils.java
@@ -4,6 +4,7 @@ import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.charset.Charset;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
@@ -264,12 +265,14 @@ public class JGitUtils {
}
public static String getRawContentAsString(Repository r, RevBlob blob) {
- return new String(getRawContent(r, blob));
+ byte [] content = getRawContent(r, blob);
+ return new String(content, Charset.forName("UTF-8"));
}
public static String getRawContentAsString(Repository r, RevCommit commit, String blobPath) {
RevObject obj = getRevObject(r, commit.getTree(), blobPath);
- return new String(getRawContent(r, (RevBlob) obj));
+ byte [] content = getRawContent(r, (RevBlob) obj);
+ return new String(content, Charset.forName("UTF-8"));
}
public static List<PathModel> getFilesInPath(Repository r, String basePath, String objectId) {