Writing file in UTF-8 format

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
bicap
Premium Member
Premium Member
Posts: 95
Joined: Mon May 03, 2010 10:22 pm
Location: India
Contact:

Writing file in UTF-8 format

Post by bicap »

Hi,

I have target as sequention file stage, fixed width, now I need to wite data in UTF-8 format. so How can I do it.
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

I'd be surprised if you can ...

UTF-8 characters are 1 to 4 bytes in length. Unless you restrict yourself to a range of UTF-8 characters having the same length, fixed width is not going to work.

If you think your data is going to have all 1-byte UTF-8 characters, you can set the NLS code page to UTF-8 in your sequential file stage (assuming it is already configured as fixed width).

If your file ends up with different record sizes, then you likely have a character that was encoded with 2-4 bytes in UTF-8.

Mike
Post Reply