Effective October 27, 2012, online and email support for FuseSource products will move to Red Hat support channels. For more information, please see the JIRA Migration to Red Hat FAQ.
As of October 27th, please open all new issues in the Red Hat Customer Portal .
Issue Details (XML | Word | Printable)

Key: MR-609
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Claus Ibsen
Reporter: Susan Javurek
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
FUSE Mediation Router

Unable to write converted body to file using alternative character sets

Created: 24/Apr/12 07:37 PM   Updated: 26/Apr/12 02:11 PM
Component/s: None
Affects Version/s: 2.8.0-fuse-03-06
Fix Version/s: 2.8.0-fuse-05-03, 2.9.0-fuse-00-00, 2.10.0-fuse-71-047

File Attachments: 1. Zip Archive dev-3953.zip (17 kB)


External Issue URL: https://issues.apache.org/jira/browse/CAMEL-5215


 Description  « Hide
Consider the following route:
<route>
  <from uri="file:./dir_in" />
  <convertBodyTo type="java.lang.byte[]" charset="iso-8859-1"/>
  <to   uri="file:./dir_out?charset=ISO-8859-1&amp;fileName=test2.xml" />
  <log message= "File converted" />
</route>

In a test file containing special chars (!"#$%) which are utf values of 21, 22, 23, 24, 25 and 0A accordingly we can see that they appear to be translated properly to iso-8859-1:

2012-04-24 15:26:50,750 [file://./dir_in] TRACE DefaultTypeConverter           - Converting byte[] -> java.io.File with value: [33, 34, 35, 36, 37, 10]
2012-04-24 15:26:50,757 [file://./dir_in] TRACE DefaultTypeConverter           - Converting org.apache.camel.component.file.GenericFileMessage -> java.io.File with value: null
2012-04-24 15:26:50,757 [file://./dir_in] TRACE DefaultTypeConverter           - Converting byte[] -> java.io.InputStream with value: [33, 34, 35, 36, 37, 10]
2012-04-24 15:26:50,757 [file://./dir_in] TRACE DefaultTypeConverter           - Using converter: StaticMethodTypeConverter: public static java.io.InputStream org.apache.camel.converter.IOConverter.toInputStream(byte[]) to convert [class [B=>class java.io.InputStream]

However, when they are written back out to the file they are translated back to UTF-8 base. I suspect this is because we use string internally but I'm not 100%.

Simple test case attached.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Susan Javurek made changes - 24/Apr/12 07:38 PM
Field Original Value New Value
Attachment dev-3953.zip [ 23005 ]
Susan Javurek made changes - 24/Apr/12 07:39 PM
Link This issue fixes DEV-3953 [ DEV-3953 ]
Claus Ibsen made changes - 25/Apr/12 07:49 AM
Assignee Claus Ibsen [ davsclaus ]
Claus Ibsen made changes - 25/Apr/12 09:53 AM
Claus Ibsen added a comment - 25/Apr/12 11:25 AM

Claus Ibsen added a comment - 26/Apr/12 12:17 PM
Backported to Fuse Camel 2.9

Claus Ibsen made changes - 26/Apr/12 12:17 PM
Fix Version/s 2.9.0-fuse-00-00 [ 11451 ]
Fix Version/s 2.10.0-fuse-00-xx [ 11600 ]
Claus Ibsen added a comment - 26/Apr/12 02:11 PM
Backported to 2.8 as well.

Claus Ibsen made changes - 26/Apr/12 02:11 PM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]