String Encoding
Since Camel 2.12
The String Data Format is a textual based format that supports encoding.
Options
The String Encoding dataformat supports 2 options, which are listed below.
Name | Default | Java Type | Description |
---|---|---|---|
charset |
|
Sets an encoding to use. Will by default use the JVM platform default charset. |
|
contentTypeHeader |
|
|
Whether the data format should set the Content-Type header with the type from the data format if the data format is capable of doing so. For example application/xml for data formats marshalling to XML, or application/json for data formats marshalling to JSon etc. |
Marshal
In this example we marshal the file content to String object in UTF-8 encoding.
from("file://data.csv").marshal().string("UTF-8").to("jms://myqueue");