2
在做这样预测HTTP charchester编码:骆驼:如何做转换
from("direct:foo").
to("http://foo.com/bar.html").
convertBodyTo(String.class, "cp1251").
to("file:///tmp/bar.html")
然而,一些网页抓取我能有编码从CP1251不同。如何确定编码(使用Content-Type
HTTP标头或meta/@ http-equiv'字符集)并使用适当的字符集调用convertBodyTo()
?可能是Camel HTTP
组件可以做到吗?什么是Exchange.HTTP_CHARACTER_ENCODING
?
我无法知道'Content-type; charset'直到我下载页面。在此之前,我无法设置Exchange.CHARSET_NAME。 – Archer
仅供参考,我填补了JIRA https://issues.apache.org/jira/browse/CAMEL-7217它。 –
对不起,发错了讯息 – Archer