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.

Reply via email to