Conversion of Unicode Fixed Length File to Simplified/Traditional Chinese

Dec 5 2008 4:36 PM
Hi

I am pretty new to the C# game and am hoping for some advice on how to solve a problem I'm working on.

I have a fixed length file (with fixed column positions - i.e. no delimiters) in Unicode characterset.
These have been created by a DTS extract job which extracts transactions and then transfers to a mainframe for processing.
My challenge is to convert the code page of the file from Unicode to Simplified or Traditional Chinese depending on the source country, while maintaining the fixed field position in the file. The other challenge is that there are a number of files and each has a different format - i.e. the transactions contain the same field in different positions in the file.

Previous attempts have converted the file though lose the fixed field positioning especially in columns that have names and addresses. I've tried using the streamreader and have converted the file from one code page to another. Also the DTS code page translation utility.

What I was going to do is to create a template with the displacements of the fields in each of the transactions.
Then for those fields that will contain Chinese characters using the Encoding function to change between Unicode to Chinese alter the field length to match that of the field and string each of the fields together and write out to the file. I don't know if I can do this due to the storage of all strings in .Net as Unicode.

If someone could provide some suggestion if this approach is plausible I'd really appreciate it. Have seen some software for $1500 US that looks as though it would do this ..... though my boss has put a freeze on our expenditure at the moment :-(

Thanks