我正在使用java读取文件。文件包含 € 字符,但 java 将其解释为¿.
即文件内容“ 12rl+€/h
”从java读取“ 12rl+¿/h
”
更新:我正在使用骆驼文件组件阅读它:
<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
}
如何解决这个问题