Problem:
How to create files that use UTF-8 or Unicode (UTF-16) character encodings?
The strings are initially ANSI based so need to be converted to UTF-8 and UTF-16.
Resolution:
Attached is an example that shows how you can do this.
Converting to Unicode uses standard COBOL syntax for dealing with Unicode strings.
UTF-8 is slightly more complex. The Windows API that performs the conversion to UTF-8 is "WideCharToMultiByte". This however requires a Unicode input string to perform the conversion on. A 2 stage conversion approach is required to first convert to Unicode and then to UTF-8 using "WideCharToMultiByte".
