]> source.dussan.org Git - gitblit.git/commitdiff
Ensure that the welcome message is interpreted as UTF-8 (issue 74)
authorJames Moger <james.moger@gitblit.com>
Fri, 16 Mar 2012 21:29:39 +0000 (17:29 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 16 Mar 2012 21:29:39 +0000 (17:29 -0400)
docs/04_releases.mkd
src/com/gitblit/wicket/pages/RepositoriesPage.java

index b2d0c7761cd9a8f4311ce9604d27600265c09972..f9e4480fbda7dae06892494f2860ac859f9a5e88 100644 (file)
@@ -30,6 +30,8 @@ Push requests to these repositories will be rejected.
 \r
 #### fixes \r
 \r
+- Ensure that Welcome message is parsed using UTF-8 encoding (issue 74) \r
+- Activity page graph layout broken by Google (issue 73)\r
 - Uppercase repositories not selectable in edit palettes (issue 71)\r
 - Not all git notes were properly displayed on the commit page (issue 70)\r
 - Activity page now displays all local branches (issue 65)\r
index 07f7ad4c40cd7b96d3a2310a35023fb69549ee80..839f4e3469a33002184d11396a91f92b4eedbe6a 100644 (file)
@@ -16,7 +16,7 @@
 package com.gitblit.wicket.pages;\r
 \r
 import java.io.File;\r
-import java.io.FileReader;\r
+import java.io.FileInputStream;\r
 import java.io.InputStream;\r
 import java.io.InputStreamReader;\r
 import java.text.MessageFormat;\r
@@ -26,6 +26,7 @@ import org.apache.wicket.Component;
 import org.apache.wicket.PageParameters;\r
 import org.apache.wicket.markup.html.basic.Label;\r
 import org.apache.wicket.resource.ContextRelativeResource;\r
+import org.eclipse.jgit.lib.Constants;\r
 \r
 import com.gitblit.GitBlit;\r
 import com.gitblit.Keys;\r
@@ -119,8 +120,11 @@ public class RepositoriesPage extends RootPage {
                                File file = new File(messageSource);\r
                                if (file.exists()) {\r
                                        try {\r
-                                               FileReader reader = new FileReader(file);\r
+                                               FileInputStream fis = new FileInputStream(file);\r
+                                               InputStreamReader reader = new InputStreamReader(fis,\r
+                                                               Constants.CHARACTER_ENCODING);\r
                                                message = MarkdownUtils.transformMarkdown(reader);\r
+                                               reader.close();\r
                                        } catch (Throwable t) {\r
                                                message = "Failed to read " + file;\r
                                                warn(message, t);\r
@@ -138,7 +142,7 @@ public class RepositoriesPage extends RootPage {
                try {\r
                        ContextRelativeResource res = WicketUtils.getResource(file);\r
                        InputStream is = res.getResourceStream().getInputStream();\r
-                       InputStreamReader reader = new InputStreamReader(is);\r
+                       InputStreamReader reader = new InputStreamReader(is, Constants.CHARACTER_ENCODING);\r
                        message = MarkdownUtils.transformMarkdown(reader);\r
                        reader.close();\r
                } catch (Throwable t) {\r