Converting existing work

This section describes some conversion issues and presents some conversion scenarios. It is assumed that existing source code and libraries cannot be quickly converted from mixed coded character sets into a common coded character set; thus a staged approach is recommended.
  • Code your new source in one coded character set, preferably IBM®-1047. Tag all new source files to make them more portable by putting the #pragma filetag directive at the top of each one.
  • If you need to interact with existing code, compile your new code using the locale in which the existing code was written.
  • If you want to write code in a coded character set that does not have a one-to-one mapping to coded character set IBM-1047 (that is, a coded character set that is not Latin-1), create your own conversion table and compile it with the genxlt utility. Use your own conversion table with the iconv utility to convert your source code to coded character set IBM-1047.