How to force Gen C servers to use code page 1201 (UTF-8)
search cancel

How to force Gen C servers to use code page 1201 (UTF-8)


Article ID: 12068


Updated On:


Gen Gen - Workstation Toolset Gen - Run Time Distributed


Need to know if there is a way to change the default code page to 1201 (UTF-8) when generating C Server servers.
For generation on Windows the server manager C code has a default code page of 1252.
In this scenario, a C server running under Linux is being targeted and would like to change the code page to 1201 to match the Oracle database codepage. A Java proxy client is being used,


Gen Distributed Processing Servers - C language.
Windows, Unix, Linux.


Gen does not explicitly support 1201 (UTF-8) for C servers on any distributed platform (Windows, Unix, Linux).
The code page that is placed into the server manager code (a remote server in this case) comes from the code page of the system that generates the code. So for the Windows Toolset or the Windows CSE it is 1252, and for the Unix/Linux CSE, it is 819.
For any OS on which Gen generates C code none would put code page 1201/UTF-8 into the generated code.

Workaround options:

  1. Manually modify the generated code (remote file) to change the referenced code page to 1201.
    The server manager generated code .c file will have this line:
    static unsigned short Code_Page = 1252;
    The 1252 needs to be changed to 1201 and then the code rebuilt.
    If generating for Linux, the server manager .rmt file can have that line changed before the .rmt file is processed by the Linux Build Tool (Implementation Toolset).

  2. Edit user exit TIRXINFO (contained in source file tirxlat.c) to return "00001201'".
    For example change this line:
              sprintf(codePage, "%08d", mbMBCS_codePage());
              sprintf(codePage, "00001201");

NOTE: There is no guarantee that either workaround will be successful 100% of the time as it depends on the exact scenario and type of client being used.