Neuron ESB User Network

The Service Bus for the Connected Business

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

Views: 253

Replies are closed for this discussion.

Replies to 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);
Thanks for your reply, I appreciate it.
However, it seems I'm still not able to get the correct output.
Could it be that Neuron alters the file input, i.e. adds the replacement character where it finds the characters æ,ø,å?
I have tried your solution with several different encodings, and also added following:
context.Data.Header.Binary = true;
Otherwise the C# step could not be validated.
Hi Per,
 
it will ONLY work with the updated adapter.  Remember, in my last reply I said I added the "detect encoding" property.  if you set it to false, then you can use the c# step code sample to decode....
 
I'll send you a link to the updated adapter

Ok thanks Marty, it works.

Thanks for the quick response! :)

RSS

Neuron ESB Product Support Forums and Communities

Latest Activity

Anupama Nair posted a discussion

Marketo Adapter Invalid Token

Hi,We are using the Marketo adapter to push account updates to Marketo. It works well for some time then starts failing with Invalid Token unless restarted. Is there a configuration that can be done so it can auto refresh the token when required?Thanks!See More
Nov 6, 2023
Sayantini Basak posted a discussion

Maximum payload size(REST API) for requests interfacing to NeuronESB

I am new to Neuron ESB and in our current scenario,We need to process batch transactions comprising of ~1000 records and send them to Neuron ESB for further processing. I would like to understand what is the maximum size of payload that can be transferred using REST interface to Neuron ESB.See More
Jul 22, 2022
Profile IconRobert E Dunie and Sayantini Basak joined Neuron ESB User Network
Apr 28, 2022
Profile IconDayanand, Frederic C, Steffen Greve-Oksfeldt and 1 more joined Neuron ESB User Network
Mar 16, 2022
Profile IconCam Vong and Mitja Luznar joined Neuron ESB User Network
Jan 27, 2022
Profile IconWill Hitzges, Chad Parsons, michael larsen and 4 more joined Neuron ESB User Network
Jun 11, 2021
Anupama Nair posted a discussion

ODBC stored proc polling with temporary tables

We have set up an ODBC adapter to poll a stored proc.We found that if the stored proc has a temporary table defined the rows returned are always 0.Any idea why this would be and what we can do to get around it?See More
Dec 14, 2020
Prasanth Kharade is now a member of Neuron ESB User Network
Dec 30, 2019

Badge

Loading…

© 2024   Created by Neuron Admin.   Powered by

Badges  |  Report an Issue  |  Terms of Service