You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2006/09/08 16:19:00 UTC

svn commit: r441508 - /incubator/roller/branches/roller_3.0/src/org/apache/roller/business/ThemeManagerImpl.java

Author: snoopdave
Date: Fri Sep  8 07:18:59 2006
New Revision: 441508

URL: http://svn.apache.org/viewvc?view=rev&rev=441508
Log:
I18N fix for reading themes from disk

Modified:
    incubator/roller/branches/roller_3.0/src/org/apache/roller/business/ThemeManagerImpl.java

Modified: incubator/roller/branches/roller_3.0/src/org/apache/roller/business/ThemeManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_3.0/src/org/apache/roller/business/ThemeManagerImpl.java?view=diff&rev=441508&r1=441507&r2=441508
==============================================================================
--- incubator/roller/branches/roller_3.0/src/org/apache/roller/business/ThemeManagerImpl.java (original)
+++ incubator/roller/branches/roller_3.0/src/org/apache/roller/business/ThemeManagerImpl.java Fri Sep  8 07:18:59 2006
@@ -24,10 +24,12 @@
 package org.apache.roller.business;
 
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.FilenameFilter;
 import java.io.IOException;
+import java.io.InputStreamReader;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Collections;
@@ -271,10 +273,13 @@
                 continue;
             }
             char[] chars = null;
+            int length;
             try {
-                FileReader reader = new FileReader(template_file);
+//                FileReader reader = new FileReader(template_file);
                 chars = new char[(int) template_file.length()];
-                reader.read(chars);            
+            	FileInputStream stream = new FileInputStream(template_file);
+            	InputStreamReader reader = new InputStreamReader(stream, "UTF-8");
+                length = reader.read(chars);            
             } catch (Exception noprob) {
                 mLogger.error("Exception while attempting to " + msg);
                 if (mLogger.isDebugEnabled()) mLogger.debug(noprob);
@@ -305,7 +310,7 @@
                     theme_name+":"+template_name,
                     template_name,
                     template_name,
-                    new String(chars),
+                    new String(chars, 0, length),
                     template_link,
                     new Date(template_file.lastModified()),
                     "velocity",