IBM Sterling Transformation Extender

Sterling Transformation Extender

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

 View Only
  • 1.  Mapping a Euro symbol manually

    Posted Tue May 03, 2016 06:58 AM

    Originally posted by: paul.brett


    I had a client with an issue where the input was defined as UTF-16 and contained a Euro Symbol (Hex 0x20 0xAC).  The output was Latin-1, which does not have an encoding for a Euro Symbol.

    The field needed to remain the same size.

    This was the solution I came up with:

    =CTEXT(SUBSTITUTE(CTEXT(TextItem:In1,"Native"),SYMBOL(32)+SYMBOL(172),SYMBOL(00)+SYMBOL(35)),"UTF16")

    With CTEXT(TextItem:In1,"Native") I forced the engine to temporarily treat the input as Native.  Using the substitute, I found and replaced the 2byte sequence for € and replaced it with the 2byte sequence for #.   Finally, the whole lot is wrapped in another CTEXT() to ensure it is treated as UTF-16 again.

    Obviously the solution could be done a variety of ways such as, setting the padding property of the output object, using the FILLRIGHT() function, etc...

    How would you have solved this requirement?

    Thank-you.

    Paul.

    Follow me on Twitter


    #IBM-Websphere-Transformation-Extender
    #DataExchange
    #IBMSterlingTransformationExtender


  • 2.  Re: Mapping a Euro symbol manually

    Posted Tue July 12, 2016 08:11 AM

    Originally posted by: Veronicadlmm


    I have a problem with the symbol €, I have in the statement ml encoding="UTF-8", but to perform the transformation, the symbol € is lost. How could solve it?

     

    I tried it with the symbol but I have not managed to fix it.


    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender
    #DataExchange


  • 3.  Re: Mapping a Euro symbol manually

    Posted Wed July 13, 2016 08:04 AM
      |   view attached

    Originally posted by: paul.brett


    The enclosed example contains an input source file with the following line:

    <Data>â'¬</Data>

    When viewed with an appropriate editor, such as notepad, you see:

    <Data>€</Data>

    When mapped with WTX, the output is:

    If you have the ASCII 0x80 in your XML file, but the encoding statement is UTF-8, then your input file is not valid.

    Let me know if this helps.

    Thank-you

    Paul

    Follow me on Twitter


    #DataExchange
    #IBM-Websphere-Transformation-Extender
    #IBMSterlingTransformationExtender

    Attachment(s)

    zip
    Euro.zip   4 KB 1 version


  • 4.  Re: Mapping a Euro symbol manually

    Posted Wed July 13, 2016 08:17 AM
      |   view attached

    Originally posted by: paul.brett


    An example invalid file.

    Sure, it looks OK in Notepad, but it's not valid.

    Thank-you

    Paul

    Follow me on Twitter


    #DataExchange
    #IBMSterlingTransformationExtender
    #IBM-Websphere-Transformation-Extender

    Attachment(s)

    xml
    Input.xml   224 B 1 version


  • 5.  Re: Mapping a Euro symbol manually

    Posted Thu July 14, 2016 05:08 AM