B2B Integration

Sterling B2B Integration

Come for answers, stay for best practices. All we're missing is you.

 View Only
  • 1.  Encoding UTF-8 with BOM (Byte Order Mark)

    Posted Wed April 29, 2020 11:56 AM

    Hello,

     

    I have a vendor requesting a .csv file encoded as UTF-8 with BOM (Byte Order Mark).

    Anyone have a suggestion as to how to produce this type of file encoding in B2Bi ?

    Thanks!

    This communication is intended to be received only by the individual[s] or entity[s] to whom or to which it is addressed, and contains information which is confidential, privileged and subject to copyright. Any unauthorized use, copying, review or disclosure is prohibited. Please notify the sender immediately if you have received this communication in error [by calling collect, if necessary] so that we can arrange for its return at our expense. Thank you in advance for your anticipated assistance and cooperation.

    Cette communication est destinée uniquement à la personne ou à la personne morale à qui elle est adressée. Elle contient de l’information confidentielle, protégée par le secret professionnel et sujette à des droits d'auteurs. Toute utilisation, reproduction, consultation ou divulgation non autorisées sont interdites. Nous vous prions d’aviser immédiatement l’expéditeur si vous avez reçu cette communication par erreur (en appelant à frais virés, si nécessaire), afin que nous puissions prendre des dispositions pour en assurer le renvoi à nos frais. Nous vous remercions à l’avance de votre coopération.

    #B2BIntegration
    #SupplyChain


  • 2.  RE: Encoding UTF-8 with BOM (Byte Order Mark)

    Posted Thu April 30, 2020 01:08 AM
    Hi,

    Please describe your scenario.  how is .csv file received and delivered?

    With Regards,
    Sreedhar.

    ------------------------------
    Sreedhar Janaswamy
    ------------------------------



  • 3.  RE: Encoding UTF-8 with BOM (Byte Order Mark)

    Posted Fri May 01, 2020 01:46 PM

    Hi,

     

    We receive a pipe-delimited input file via SFTP into SFG. This input file contains some French language characters.

    We run the input file thru a B2Bi map, which translates it into .csv output (set as UTF8 output encoding in the map).

    The output looks good to us, and the French characters match exactly what was in the input file.

     

    We SFTP the .csv file to our vendor, and they are saying the French characters "look funny" when they load the file into their system, so they requested that we encode the .csv file with BOM.  I need assistance on how to produce this type of file encoding in B2Bi ?

     

    Thanks for your help!

     

    This communication is intended to be received only by the individual[s] or entity[s] to whom or to which it is addressed, and contains information which is confidential, privileged and subject to copyright. Any unauthorized use, copying, review or disclosure is prohibited. Please notify the sender immediately if you have received this communication in error [by calling collect, if necessary] so that we can arrange for its return at our expense. Thank you in advance for your anticipated assistance and cooperation.

    Cette communication est destinée uniquement à la personne ou à la personne morale à qui elle est adressée. Elle contient de l’information confidentielle, protégée par le secret professionnel et sujette à des droits d'auteurs. Toute utilisation, reproduction, consultation ou divulgation non autorisées sont interdites. Nous vous prions d’aviser immédiatement l’expéditeur si vous avez reçu cette communication par erreur (en appelant à frais virés, si nécessaire), afin que nous puissions prendre des dispositions pour en assurer le renvoi à nos frais. Nous vous remercions à l’avance de votre coopération.





  • 4.  RE: Encoding UTF-8 with BOM (Byte Order Mark)

    Posted Fri May 01, 2020 02:49 PM
    UTF-8 with BOM seems not supported in B2Bi, but this cane achieved through the map or with BP. Please try one of the below

    • Use the map to pre-fix these BOM marks on the very first field and record like #field = "^EF^BB^BF" + #field;
    • Use Document keyword replace to replace the first few characters like here <assign to="replace1" from="string('&#xef;&#xbb;&#xbf;')"/>


    ------------------------------
    Rajasekhar Muthamsetty
    ------------------------------



  • 5.  RE: Encoding UTF-8 with BOM (Byte Order Mark)

    Posted Tue May 05, 2020 02:03 PM

    We will implement one of these suggested methods. Thanks very much!  

     

     

    This communication is intended to be received only by the individual[s] or entity[s] to whom or to which it is addressed, and contains information which is confidential, privileged and subject to copyright. Any unauthorized use, copying, review or disclosure is prohibited. Please notify the sender immediately if you have received this communication in error [by calling collect, if necessary] so that we can arrange for its return at our expense. Thank you in advance for your anticipated assistance and cooperation.

    Cette communication est destinée uniquement à la personne ou à la personne morale à qui elle est adressée. Elle contient de l’information confidentielle, protégée par le secret professionnel et sujette à des droits d'auteurs. Toute utilisation, reproduction, consultation ou divulgation non autorisées sont interdites. Nous vous prions d’aviser immédiatement l’expéditeur si vous avez reçu cette communication par erreur (en appelant à frais virés, si nécessaire), afin que nous puissions prendre des dispositions pour en assurer le renvoi à nos frais. Nous vous remercions à l’avance de votre coopération.





  • 6.  RE: Encoding UTF-8 with BOM (Byte Order Mark)

    Posted Mon May 04, 2020 08:16 AM
    As per my understanding they want to change the encoding format of file they have received before pushing it out of B2Bi.
    There is Encoding Conversion Service which acts on the input file and coverts from input format to output format
    https://www.ibm.com/support/knowledgecenter/SS3JSW_5.2.0/com.ibm.help.svcs_adpts_a_l.doc/Encoding_Conversion_svc.html
    Use the Encoding Conversion service in a business process. When creating a business process, determine whether to extract the converted file from Sterling B2B Integrator to a specific file location. To extract the file, follow the Encoding Conversion service with a File System adapter configuration in your business process.
    www.ibm.com
    Also customer can refer whether this service  'XML Encoder service' an option which they can use before doing any XML translation.


    ------------------------------
    Rashmi Acharya
    ------------------------------



  • 7.  RE: Encoding UTF-8 with BOM (Byte Order Mark)

    Posted Tue May 05, 2020 01:49 PM

    We tried using Encoding Conversion Service in B2Bi, but couldn't figure out proper value for output_encoding setting, in order to produce UTF-8 with BOM.

    My GPM (Graphical Process Modeler) won't load, so I can't look in GPM for options on output_encoding values.

    And I haven't been able to find any documentation that shows options for output_encoding values.

    Can you suggest what to try as output_encoding value?

     

     

    This communication is intended to be received only by the individual[s] or entity[s] to whom or to which it is addressed, and contains information which is confidential, privileged and subject to copyright. Any unauthorized use, copying, review or disclosure is prohibited. Please notify the sender immediately if you have received this communication in error [by calling collect, if necessary] so that we can arrange for its return at our expense. Thank you in advance for your anticipated assistance and cooperation.

    Cette communication est destinée uniquement à la personne ou à la personne morale à qui elle est adressée. Elle contient de l’information confidentielle, protégée par le secret professionnel et sujette à des droits d'auteurs. Toute utilisation, reproduction, consultation ou divulgation non autorisées sont interdites. Nous vous prions d’aviser immédiatement l’expéditeur si vous avez reçu cette communication par erreur (en appelant à frais virés, si nécessaire), afin que nous puissions prendre des dispositions pour en assurer le renvoi à nos frais. Nous vous remercions à l’avance de votre coopération.





  • 8.  RE: Encoding UTF-8 with BOM (Byte Order Mark)

    Posted Wed May 06, 2020 04:04 PM
    If you are not able to generate UTF-8 BOM document using previous methods, then follow below. 

    1. Create Java Task Service and add below code to it
    import java.io.ByteArrayInputStream;import java.io.ByteArrayInputStream;import java.io.InputStream;import java.io.OutputStream;import java.io.SequenceInputStream;import com.sterlingcommerce.woodstock.workflow.Document;import com.sterlingcommerce.woodstock.workflow.WorkFlowContext;byte[] bom = {(byte)239, (byte)187, (byte)191};Document doc = wfc.getPrimaryDocument();InputStream isDoc = doc.getBodyInputStream();InputStream seqStream = new SequenceInputStream(new ByteArrayInputStream(bom), isDoc);int read;byte[] bytes = new byte[1024];Document newDoc = wfc.newDocument();;OutputStream os = newDoc.getOutputStream();    while ((read = seqStream.read(bytes)) != -1) {          os.write(bytes, 0, read);       }wfc.putPrimaryDocument(newDoc);os.flush();os.close(); seqStream.close();isDoc.close();return "000";

    2. In your BP, encode document with UTF-8 using Encoding Conversion service
    3. call the Javatask service you created in step-1
    4. When you run the BP, Javatask will generate new PrimaryDocument that has BOM in it

    -Dhiraj Patil

    ------------------------------
    Dhiraj Patil
    ------------------------------



  • 9.  RE: Encoding UTF-8 with BOM (Byte Order Mark)

    Posted Fri May 01, 2020 05:59 AM
    A BOM is a simple sequence of 3 bytes at the beginning of the file:

    0xEF 0xBB 0xBF


    If B2Bi can't do it, it is a simple matter for Transformation Extender.  An example rule might be:

    ="<<EF>><<BB>><<BF>>"+PACKAGE(Input)

    I hope B2Bi can do it natively (other experts can weigh-in) but if not, ITX is one way to achieve it.

    Thank you.

    ------------------------------
    Paul Brett
     
    IBM Sterling Transformation Extender (ITX) Client Support
    ------------------------------