You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by sarfaraj <sa...@gmail.com> on 2013/02/14 06:15:12 UTC

How to create csv with UTF-8 encoding using the Spring/XML DSL

Hi,

I want to create csv file with UTF-8 encoding.

Using *CSV *component i am abale to create the csv file but with ANSI
encoding. (Please refer below code) 

<to uri="bean:csvTranslator" />
	<marshal>
		<csv />
	</marshal>
<to uri="file:src/fileserver?fileName=test.csv" />

Could someone tell me how to create csv file with UTF-8 encoding using the
Spring/XML DSL.

/Sarfaraj



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-create-csv-with-UTF-8-encoding-using-the-Spring-XML-DSL-tp5727566.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to create csv with UTF-8 encoding using the Spring/XML DSL

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Feb 14, 2013 at 1:18 PM, sarfaraj <sa...@gmail.com> wrote:
> Looks like it's available in Camel 2.9.3.
>
> What about 2.8.5 ? do we have any other way to achieve the same in 2.8.5 ?
>

You can try setting the charset on the exchange property as mentioned
in the description of the charset option in the file docs.

Or you can write the file yourself with a little java code, or maybe
convert the payload first

<convertBodyTo type="byte[].class" charset="utf-8"/>
<to ...>


>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-create-csv-with-UTF-8-encoding-using-the-Spring-XML-DSL-tp5727566p5727586.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: How to create csv with UTF-8 encoding using the Spring/XML DSL

Posted by sarfaraj <sa...@gmail.com>.
Looks like it's available in Camel 2.9.3.

What about 2.8.5 ? do we have any other way to achieve the same in 2.8.5 ? 



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-create-csv-with-UTF-8-encoding-using-the-Spring-XML-DSL-tp5727566p5727586.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to create csv with UTF-8 encoding using the Spring/XML DSL

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Feb 14, 2013 at 6:15 AM, sarfaraj <sa...@gmail.com> wrote:
> Hi,
>
> I want to create csv file with UTF-8 encoding.
>
> Using *CSV *component i am abale to create the csv file but with ANSI
> encoding. (Please refer below code)
>
> <to uri="bean:csvTranslator" />
>         <marshal>
>                 <csv />
>         </marshal>
> <to uri="file:src/fileserver?fileName=test.csv" />
>
> Could someone tell me how to create csv file with UTF-8 encoding using the
> Spring/XML DSL.
>

There is a charset option on the file endpoint
http://camel.apache.org/file2

> /Sarfaraj
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-create-csv-with-UTF-8-encoding-using-the-Spring-XML-DSL-tp5727566.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen