0

Where can I define the encoding of my input file in order to be correctly read by Bindy ? My input file is ISO-8859-1, CRLF My local is UTF-8 (I don't to change it...)

So when I read my file some character are wrong...

camel:

.process(debugProcessor)
        .unmarshal().bindy(BindyType.Csv, "mypackage.com")

Bindy:

@CsvRecord(separator = "\u0009", skipFirstLine = true)
public class elModel extends elModelGeneric{

/** Général */

@DataField(pos = 1)
/* N° id. */ String id;
...
Nicolas Hauzaree
  • 743
  • 1
  • 5
  • 9

2 Answers2

0

Set the encoding when reading your source. If your source is a file, this is defined as follows:

from("file:inbox?charset=ISO-8859-1")
    .process(debugProcessor)
    .unmarshal().bindy(BindyType.Csv, "mypackage.com")
    ...
Peter Keller
  • 7,526
  • 2
  • 26
  • 29
  • Thanks this work fine to read the file. I'm actually having some trouble with Bindy : from("file:inbox?charset=ISO-8859-1") .process(debugProcessor) .unmarshal().bindy(BindyType.Csv, "mypackage.com") – Nicolas Hauzaree Jul 09 '14 at 08:42
0

Thanks this work fine to read correctly the file. I'm actually having some trouble with Bindy : This as a test sample doesn't work :

from("file:inbox?charset=ISO-8859-1")
.process(debugProcessor)
.unmarshal().bindy(BindyType.Csv, "mypackage.com")
.marshal().bindy(BindyType.Csv, "mypackage.com")
.to("file:output/test.csv?charset=UTF-8");

The output encoding is wrong (it contains some "?" characters for "é" input char) Could it be related to the Locale needed for Bindy to be set ? I made several tests but couldn't get the right output.

Nicolas Hauzaree
  • 743
  • 1
  • 5
  • 9
  • 1
    The file:inbox?charset=ISO-8859-1 route adds a CamelCharsetName header that will be used by bindy. Either try using UTF-8 instead or remove that header. – kaviddiss Jul 24 '17 at 22:18