Hi,

Here is my route:

<camel:camelContext xmlns="http://camel.apache.org/schema/spring";>
        <endpoint id="fileConsumer"

uri="file:///tmp?preMove=.inprogress&amp;move=.done&amp;moveFailed=.error&amp;delay=400&amp;noop=false"/>

        <camel:route id="integration-start" startupOrder="1">
            <camel:from uri="direct:start"/>
            <camel:to uri="file:///tmp"/>
        </camel:route>

        <camel:route id="test-route" startupOrder="2">
            <camel:from ref="fileConsumer"/>
            <camel:convertBodyTo type="java.lang.String" charset="UTF-8"/>
            <camel:split streaming="true">
                <camel:tokenize token="\*\*\n" regex="true"/>
                <camel:to uri="direct:out"/>
            </camel:split>
        </camel:route>

        <camel:route id="integration-end" startupOrder="3">
            <camel:from uri="direct:out"/>
            <camel:to uri="mock:result"/>
        </camel:route>
    </camel:camelContext>

The file is encoded as iso-8859-1, the locale on the system is utf-8

I think the file consumer is reading the data incorrectly *before* I
can convert it with <convertBodyTo>, the FileConsumer is reading the
data as UTF-8 when it should be reading as ISO-8859-1

Annoyingly iconv -f ISO-8859-1 -t UTF-8 <file> works perfectly and
converts the characters correctly - I really don't want to have to
shell out to iconv to perform conversion before consuming the file,
but at the moment it seems to be the sanest way of dealing with this
problem

Thanks,
Kev

Reply via email to