[ 
https://issues.apache.org/activemq/browse/CAMEL-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=51458#action_51458
 ] 

Claus Ibsen commented on CAMEL-1573:
------------------------------------

That constant is in Camel 2.0. In Camel 1.x its somewhere else.

You should really use org.w3c.Document as the type if you want to read an XML 
file. It will leverage the Java XML API to read and understand the encoding 
option in the XML files.
Then afterwards you can get it as a String.

Or the javax.xml.transform.stream.StreamSource should also be doable.

Camel cannot really know its a XML file, unless we add some convention that if 
the file name extension is xml it should use the XML converters.

> convertBodyTo should have an optional parameter for setting the encoding
> ------------------------------------------------------------------------
>
>                 Key: CAMEL-1573
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1573
>             Project: Apache Camel
>          Issue Type: Improvement
>    Affects Versions: 2.0-M1
>            Reporter: Christian Schneider
>             Fix For: 2.0-M2
>
>
> When converting data  from a binary form the convertBodyTo(String.class) 
> function currently does not support changing the encoding. This should be 
> added.  Additionally it would be nice to have automatic encoding settings for 
> xml files that contain a <?xml header with an encoding attribute.
> The issue happened for me when I tried to read from a FileEndpoint. I have 
> debugged into the code and found that where the file is read there seems to 
> be no support for encoding at all. But maybe I am wrong. I will search for 
> the place in the code and post a link here.
> http://www.nabble.com/Convert-File-to-String-with-encoding-to23291163.html

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to