* autoload.cc: Autoload CharToOemA.
* dcrt0.cc (dll_crt0_1): Translate command line to OEM if current codepage is OEM. * environ.cc: Add new option 'codepage' to CYGWIN environment variable. * fhandler_clipboard.cc (fhandler_clipboard::read): Read clipboard in OEM mode if current codepage is OEM. * fhandler_console.cc (fhandler_console::read): Only translate console input if current codepage is ANSI. * fhandler_console.cc (fhandler_console::write_normal): Translate output data if current codepage is ANSI. * pinfo.cc (codepage_init): New function. Setup current codepage from CYGWIN environment variable and set codepage for file APIs. * security.cc (read_sd): Translate file name to it if current codepage is OEM. * winsup.h: (sys_wcstombs,sys_mbstowcs): Use current codepage for translations between multibyte and widechar string and vice versa.
This commit is contained in:
@@ -87,6 +87,31 @@ set_myself (pid_t pid, HANDLE h)
|
||||
return;
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
codepage_init (const char *buf)
|
||||
{
|
||||
if (!buf || !*buf)
|
||||
return;
|
||||
|
||||
if ( strcmp ( buf, "oem" ) == 0 )
|
||||
{
|
||||
current_codepage = oem_cp;
|
||||
SetFileApisToOEM ();
|
||||
debug_printf ( "File APIs set to OEM" );
|
||||
}
|
||||
else if ( strcmp ( buf, "ansi" ) == 0 )
|
||||
{
|
||||
current_codepage = ansi_cp;
|
||||
SetFileApisToANSI ();
|
||||
debug_printf ( "File APIs set to ANSI" );
|
||||
}
|
||||
else
|
||||
{
|
||||
debug_printf ( "Wrong codepage name: %s", buf );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Initialize the process table entry for the current task.
|
||||
This is not called for fork'd tasks, only exec'd ones. */
|
||||
void __stdcall
|
||||
|
Reference in New Issue
Block a user