This call allows a process to set its code page and the session's display code page and keyboard code page.
DosSetCp
CodePage (USHORT) - input
Value
DosSetCp allows a program to set its code page. See CONFIG.SYS and the CODEPAGE command for preparing code pages for the system. The first code page specified in the CODEPAGE command is the default system code page. The session code page of a new session is set to the default system code page. A session's code page can be changed by the user with the CHCP command at the command prompt. The process code page of a new program started from a session command prompt is set to that session's code page.
DosSetCp sets the process code page of the calling process. The code page of a process is used in a series of ways. First, the printer code page is set to the process code page through the file system and printer spooler when the process makes an open printer request. Calling DosSetCp does not affect the code page of a printer opened prior to the call and does not affect the code page of a printer opened by another process. Second, country dependent information, by default, is retrieved encoded in the code page of the calling process. And third, a newly created process inherits its process code page from its parent process.
DosSetCp also sets, in the session to which the calling process belongs, the code page for the session's default logical keyboard and automatically flushes the keyboard buffer. It also sets the display code page for the session's logical display. This setting of the code page for the session's default logical keyboard and display overrides any previous setting by DosSetCp, DosSetProcCp, KbdSetCp, and VioSetCp by any process in the same session. Also see DosSetProcCp.