External Interface Handling
Creo TOOLKIT applications running in Unicode will need to create utilities around the interfaces between non-Unicode aware third-party APIs and interfaces. While PTC cannot directly provide such interfaces, this section discusses the considerations for creating such utilities by showing how one external API such as the C runtime library can be used from a Unicode environment.
Any C runtime library accepting char* or wchar_t* as input may be adversely affected by receiving Unicode data. Typically, it should be possible to create a simple wrapper for each C runtime interface used in the application, where the input string to the interface is expected to be in Unicode. The string should be transcoded before calling the system API. Examples of such C runtime functions are listed below (this is not an exhaustive list):
• fopen()
• access(), _access()
• chdir(), readdir(), opendir()
• chmod(), _chmod()
• findfirst(), _findnext()
• getcwd()
• getenv()
• open(), opendir()
◦ fgetc()
◦ fgets()
◦ fputc()
◦ fputs()
◦ fread(), fwrite()
◦ puts()
• remove(), stat(), system(), tmpfile(), unlink()