camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject git commit: fixed the Netty type converter encoding issue which results in NettyHttpEndpointUriEncodingIssueTest.testEndpointUriWithDanishCharEncodingIssue to fail
Date Mon, 13 May 2013 21:35:59 GMT
Updated Branches:
  refs/heads/master d929748f0 -> dbd0ce546


fixed the Netty type converter encoding issue which results in NettyHttpEndpointUriEncodingIssueTest.testEndpointUriWithDanishCharEncodingIssue
to fail


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

Branch: refs/heads/master
Commit: dbd0ce546972e17efde3e451ec3ca62eade73708
Parents: d929748
Author: cmueller <cmueller@apache.org>
Authored: Mon May 13 23:35:40 2013 +0200
Committer: cmueller <cmueller@apache.org>
Committed: Mon May 13 23:35:40 2013 +0200

----------------------------------------------------------------------
 .../camel/component/netty/NettyConverter.java      |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/dbd0ce54/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConverter.java
----------------------------------------------------------------------
diff --git a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConverter.java
b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConverter.java
index 73a2e12..0638138 100644
--- a/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConverter.java
+++ b/components/camel-netty/src/main/java/org/apache/camel/component/netty/NettyConverter.java
@@ -20,6 +20,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.ObjectInput;
 import java.io.ObjectInputStream;
+import java.io.UnsupportedEncodingException;
 
 import org.apache.camel.Converter;
 import org.apache.camel.Exchange;
@@ -45,13 +46,13 @@ public final class NettyConverter {
     }
 
     @Converter
-    public static String toString(ChannelBuffer buffer, Exchange exchange) {
+    public static String toString(ChannelBuffer buffer, Exchange exchange) throws UnsupportedEncodingException
{
         byte[] bytes = toByteArray(buffer);
         // use type converter as it can handle encoding set on the Exchange
         if (exchange != null) {
             return exchange.getContext().getTypeConverter().convertTo(String.class, exchange,
bytes);
         }
-        return new String(bytes);
+        return new String(bytes, "UTF-8");
     }
 
     @Converter


Mime
View raw message