Hi,
I have an issue with files downloaded from FTP vendor, its probably a setup mistake I made.
Example:
Error characters:
BE;NO1;Eastern Norway. South of V�g�mo (300kV) and Ulset(132kV). East of R�d (420kV), Rjukan (420kV),Vemorktoppen (300kV), Tokke (300kV), Hof (300kV)
Should be:
BE;NO1;Eastern Norway. South of Vågåmo (300kV) and Ulset(132kV). East of Rød (420kV), Rjukan (420kV),Vemorktoppen (300kV), Tokke (300kV), Hof (300kV)
Above is taken from Activity->Message history.
I tried both Ascii and Binary setting on ftp adapter.
Running Neuron 3.5.4.1139
Thanks in advance
Tags:
Replies are closed for this discussion.
Hi Per,
it has something to do with the encoding of the message.
I had the same issue with danish characters and when the message does not specify UTF-8 encoding that's how it looks like in the Message History.
Not really sure how to solve it in your scenario but maybe it can help.
Fabrizio
Ok…I looked into this.
This is behaving as designed though…but I think we can make a tweak that makes sense.
In short the data is being encoded as ASCII because the file with the data on the FTP server is saved as an ASCII file. If this file was saved as a Unicode file on the FTP server, the data would come across as you would expect. Internally, once we receive the data (regardless of the way we download i.e. ASCII or binary) we look at the BOM of the file to try to determine the encoding. If the file BOM tells us its ASCII, then we use that encoder.
Solution 1.) What you could do to correct this is ensure that the file is saved as a Unicode file on the FTP server. That way, we’ll detect the correct encoding.
Solution 2.) The tweak I was talking about that we could make though is to ensure that we simply just pass the data through as binary, if Binary is selected as the Transfer type…..which kind of makes sense.
But that means you’ll get a byte array as the esb message body. You’ll have to do use the Unicode encoder within a Business Process to decode it to the format that you will expect….providing you need to work with the data in text format.
Thoughts?
Actually....took this a step further....added a "Detect Encoding" property....default value is true. When true....existing functionality would stay the same regardless of transfer type setting (i.e. Binary or ascii). however, if set to false, we would pass the data through as a byte array....
then in a process, you could do something like this in a C# step:
var value = System.Text.Encoding.GetEncoding("utf-7").GetString(context.Data.Bytes);
context.Data.FromString(value);
Ok thanks Marty, it works.
Thanks for the quick response! :)
Neuron ESB Product Support Forums and Communities
© 2024 Created by Neuron Admin. Powered by