I’m reading file using java. File contains € chars but java interpret it like ¿.
i.e. file content “12rl+€/h” reading from java “12rl+¿/h”
UPDATE:
I’m reading it with using camel file component:
<camel:route id="FileProcessor">
<camel:from uri="file:c://my/temp/" />
<camel:log message="File ${body}" loggingLevel="DEBUG" logName="CamelLogger"/>
<camel:process ref="fileProcessor"/>
<camel:log message="File has been processed" loggingLevel="DEBUG" logName="CamelLogger"/>
</camel:route>
public class FileProcessor implements Processor {
private static final Logger logger = LoggerFactory.getLogger(FileProcessor.class);
public FileProcessor() {
}
@Override
public void process(Exchange exchange) throws Exception {
String fileContent = exchange.getIn().getBody(String.class);
//Buisness logic with file
}
How to fix this
I’ve never used Camel, but Google lead me to this documentation page, which explains that an option can be added to the URL to specify the charset: