camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [2/2] git commit: CAMEL-7315 specify the charset when loading the converter with thanks to Knut-Olav
Date Fri, 28 Mar 2014 08:36:30 GMT
CAMEL-7315 specify the charset when loading the converter with thanks to Knut-Olav


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/cb42a3a1
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/cb42a3a1
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/cb42a3a1

Branch: refs/heads/camel-2.12.x
Commit: cb42a3a181d91b9d60ed291161b44c1f64596d4d
Parents: ced3c08
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Fri Mar 28 16:31:54 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Fri Mar 28 16:36:05 2014 +0800

----------------------------------------------------------------------
 .../camel/impl/converter/AnnotationTypeConverterLoader.java      | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/cb42a3a1/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
----------------------------------------------------------------------
diff --git a/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
b/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
index 74e3f0e..f493b7e 100644
--- a/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
+++ b/camel-core/src/main/java/org/apache/camel/impl/converter/AnnotationTypeConverterLoader.java
@@ -21,6 +21,7 @@ import java.io.IOException;
 import java.io.InputStreamReader;
 import java.lang.reflect.Method;
 import java.net.URL;
+import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Enumeration;
@@ -66,6 +67,7 @@ import org.slf4j.LoggerFactory;
 public class AnnotationTypeConverterLoader implements TypeConverterLoader {
     public static final String META_INF_SERVICES = "META-INF/services/org/apache/camel/TypeConverter";
     private static final Logger LOG = LoggerFactory.getLogger(AnnotationTypeConverterLoader.class);
+    private static final Charset UTF8 = Charset.forName("UTF-8");
     protected PackageScanClassResolver resolver;
     protected Set<Class<?>> visitedClasses = new HashSet<Class<?>>();
     protected Set<String> visitedURIs = new HashSet<String>();
@@ -214,7 +216,7 @@ public class AnnotationTypeConverterLoader implements TypeConverterLoader
{
                 // remember we have visited this uri so we wont read it twice
                 visitedURIs.add(path);
                 LOG.debug("Loading file {} to retrieve list of packages, from url: {}", META_INF_SERVICES,
url);
-                BufferedReader reader = IOHelper.buffered(new InputStreamReader(url.openStream()));
+                BufferedReader reader = IOHelper.buffered(new InputStreamReader(url.openStream(),
UTF8));
                 try {
                     while (true) {
                         String line = reader.readLine();


Mime
View raw message