Home |
RTTarget-32 Programming Manual Running Win32 Programs without Win32 Running a Program on the Target Win32 File I/O Win32 Date and Time Management Win32 Thread Local Storage (TLS) Win32 API Function Cross Reference Alternate Heap Manager RTTHeap Compiling and Linking with On Time RTOS-32 |
Win32 File I/ORTTarget-32 supports RAM files, LPT files, screen output via stdout and stderr, and keyboard input via stdin through functions such as CreateFile, ReadFile, WriteFile, etc. Screen output can be redirected to the host during software development for targets without a display (see Function RTDisplayChar). The RAM File System is replaced by RTFiles-32 or the SMB Client, if linked. Please see also section Installable File System. File Names in OEM or ANSI Code PagesThe ASCII version of the Win32 File I/O API (functions CreateFileA, FindFirstFileA, etc) will not perform any code page translation. Rather, the file names are passed on to the underlying installed file system driver. RTTarget-32's RAM file system accepts names in any code page. By default, RTFiles-32 and the SMB Client expect file names in the OEM character set. File Names in UnicodeMost widechar versions of the Win32 file I/O API (such as functions CreateFileW, FindFirstFileW, LoadLibraryW, etc) are also supported. However, such calls merely translate the given Unicode name to an ASCII name and then call the corresponding ASCII API function. By default, the translation produces names in the OEM charset. If a different code page is desired, both RTTarget-32's Win32 API emulation layer as well as the underlying file system must be informed. To use ASCII file names in ANSI, execute this code at program startup: SetFileApisToANSI(); // inform RTTarget-32 (always required) RTFSetCodePageANSI(); // inform RTFiles-32 (if used) To revert back to OEM file names (which is the default), use this code: SetFileApisToOEM(); RTFSetCodePageOEM(); Using UTF-8, full Unicode support is available: #ifndef CP_UTF8 #define CP_UTF8 65001 #endif RTSetFileApisTo(CP_UTF8, NULL); RTFSetCodePageUTF8();
|