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