From 3e087ada55f8b0e83b146578b695552db9dc8d97 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Wed, 27 Apr 2011 20:55:38 -0400
Subject: [PATCH] Integrated pagelinks into RepositoryPage. Fixed string encoding.

---
 src/com/gitblit/utils/JGitUtils.java |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/com/gitblit/utils/JGitUtils.java b/src/com/gitblit/utils/JGitUtils.java
index e5dbfd2..8814c1f 100644
--- a/src/com/gitblit/utils/JGitUtils.java
+++ b/src/com/gitblit/utils/JGitUtils.java
@@ -4,6 +4,7 @@
 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 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) {

--
Gitblit v1.9.1