camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ioannis Mavroukakis <imavrouka...@gmail.com>
Subject Re: Unicode characters not recognizing when reading file
Date Wed, 13 Apr 2016 20:43:01 GMT
Try,

file(from).split(body(String.class).tokenize("\r\n")).streaming().to(file)

I'm not sure why it doesn't work for you, not having a relevant input 
file to test makes it a little bit of guesswork..alternatively you could 
scrub all \r\n to become \n before processing?

patelp7 wrote:
>
> Not true exactly. It has to do with some camel component. I tried few 
> things.
>
> 1) Route: file(from).split(body()).streaming().to(file) /This scenario
> preserves the character./
> 2) Route:
> file(from).convertBodyTo(String.class,"UTF-8").split(body()).streaming().to(file)
> /This scenario converts the character to ?/
> 3) Route: file(from).split(body().tokenize("\r\n").streaming().to(file)
> /This route won't even run. Gives me error
> org.apache.camel.RuntimeCamelException: Scanner aborted because of an
> IOException!/
> 4) Route: file(from).split(body().tokenize("\n").streaming().to(file) 
> /This
> scenario preserves the character/
>
> The problem is my file has EOL "\r\n" so I have to use #3 for routing and
> because its giving me exception I am using solution#2 and #3 together 
> which
> changes my character.
>
> Is there a work around?
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Unicode-characters-not-recognizing-when-reading-file-tp5781028p5781038.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message