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