You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Roland Villemoes <rv...@alpha-solutions.dk> on 2010/08/27 12:00:16 UTC

Using Camel-ftp to write file with windows-1252 encoding

Hi 

I am using Camel-2.2.0 and camel-ftp-2.2.0. 

The issue is that i am using camel-ftp to create file on a windows FTP
server and the file must be in windows-1252 :-(

My code is running on a Linux server (running
apache-servicemix-4.2.0-fuse-01-00).

I have tried to set parameter on the endpoint to binary=true and to do
someting like:

byte[] origStringInBytes=sb.toString().getBytes("UTF-8");
String contentInWindows1252 = new String(origStringInBytes, "windows-1252");
exchange.getOut().setBody(sb.toString());

Anyone having same issue? 
-- 
View this message in context: http://camel.465427.n5.nabble.com/Using-Camel-ftp-to-write-file-with-windows-1252-encoding-tp2739750p2739750.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using Camel-ftp to write file with windows-1252 encoding

Posted by Roland Villemoes <rv...@alpha-solutions.dk>.
Hi Willem,

Seems like this works! Thanks a lot (again )


Roland
-- 
View this message in context: http://camel.465427.n5.nabble.com/Using-Camel-ftp-to-write-file-with-windows-1252-encoding-tp2739750p2805738.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Using Camel-ftp to write file with windows-1252 encoding

Posted by "Willem.Jiang" <wi...@gmail.com>.
Did you try to set the exchange.setProperty(Exchange.CHARSET_NAME,
"windows-1252") like this?
And I need to check your route to see if there is anything that I missed.

Willem


Roland Villemoes wrote:
> 
> Hi 
> 
> I am using Camel-2.2.0 and camel-ftp-2.2.0. 
> 
> The issue is that i am using camel-ftp to create file on a windows FTP
> server and the file must be in windows-1252 :-(
> 
> My code is running on a Linux server (running
> apache-servicemix-4.2.0-fuse-01-00).
> 
> I have tried to set parameter on the endpoint to binary=true and to do
> someting like:
> 
> byte[] origStringInBytes=sb.toString().getBytes("UTF-8");
> String contentInWindows1252 = new String(origStringInBytes,
> "windows-1252");
> exchange.getOut().setBody(sb.toString());
> 
> Anyone having same issue? 
> 
-- 
View this message in context: http://camel.465427.n5.nabble.com/Using-Camel-ftp-to-write-file-with-windows-1252-encoding-tp2739750p2805549.html
Sent from the Camel - Users mailing list archive at Nabble.com.