* dcrt0.cc (dll_crt0_1): Use GetCommandLineW and convert to current
codepage. * environ.cc (set_file_api_mode): Always set file api to ANSI if not using the OEM codepage. (codepage_init): Allow "utf8" codepage. * fhandler_clipboard.cc (set_clipboard): Convert clipbuf to void and cast as needed. Always convert input to wide char and write CF_UNICODETEXT to clipboard. (fhandler_dev_clipboard::read): Read CF_UNICODETEXT from clipboard and convert to current codepage if CYGWIN_NATIVE format is not available. * fhandler_console.cc: Drop redundant undef. * smallprint.cc (__small_vsprintf): Convert PWCHAR and UNICODE_STRING to current codepage for printing. * strfuncs.cc: Use PWCHAR throughout. (get_cp): Return CP_UTF8 for utf8_cp codepage setting. (sys_wcstombs): Allow NULL target buffer. (sys_wcstombs_alloc): New function. (sys_mbstowcs_alloc): Ditto. * winsup.h (codepage_type): Add utf8_cp. (HEAP_NOTHEAP): Define. (sys_wcstombs_alloc): Declare. (sys_mbstowcs_alloc): Declare.
This commit is contained in:
@ -506,7 +506,7 @@ set_file_api_mode (codepage_type cp)
|
||||
SetFileApisToOEM ();
|
||||
debug_printf ("File APIs set to OEM");
|
||||
}
|
||||
else if (cp == ansi_cp)
|
||||
else
|
||||
{
|
||||
SetFileApisToANSI ();
|
||||
debug_printf ("File APIs set to ANSI");
|
||||
@ -520,17 +520,14 @@ codepage_init (const char *buf)
|
||||
return;
|
||||
|
||||
if (strcasematch (buf, "oem"))
|
||||
{
|
||||
current_codepage = oem_cp;
|
||||
set_file_api_mode (current_codepage);
|
||||
}
|
||||
current_codepage = oem_cp;
|
||||
else if (strcasematch (buf, "ansi"))
|
||||
{
|
||||
current_codepage = ansi_cp;
|
||||
set_file_api_mode (current_codepage);
|
||||
}
|
||||
current_codepage = ansi_cp;
|
||||
else if (strcasematch (buf, "utf8"))
|
||||
current_codepage = utf8_cp;
|
||||
else
|
||||
debug_printf ("Wrong codepage name: %s", buf);
|
||||
set_file_api_mode (current_codepage);
|
||||
}
|
||||
|
||||
static void
|
||||
|
Reference in New Issue
Block a user