cygheap.h: - Replace 'charset' field in cygheap_locale with 'int charset_index' cygheap.cc: - Initialise 'charset_index' to zero winsup/cygwin/wchar.h: - Change mbtowc_f and wctomb_f typedefs to take an int argument instead of the charset string - Same for the sys_cp_wcstombs/mbstowcs prototypes - add extern declaration for __charset_index fhandler.h: - Replace charset argument to str_to_con with 'int cs_idx' fhandler_console.cc: - Reflect changes above in function definitions and calls - In write_normal(), replace 'charset' local with 'int cs_idx'. Where currently 'charset' is set to "CP437", set cs_idx to 0 (which is the index for CP437) winsup/cygwin/strfuncs.cc - Replace the charset arguments of all the __xxx_wctomb/mbtowc functions - Same for sys_cp_wcstombs/mbstowcs - When testing whether the selected charset is UTF-8, do so by comparing f_mbtowc/wctomb against __utf8_mbtowc/wctomb - Pass 0 as the charset index in direct calls to __utf8_mbtowc/wctomb winsup/cygwin/nlsfuncs.cc: - Reflect header changes above - Also change these functions to take a charset index instead of a string: lc_wcstombs, lc_mbstowcs, __getlocaleinfo, __eval_datetimefmt, __set_lc_time_from_win, __set_lc_monetary_from_win, __collate_load_locale - Change calls to affected functions. There's a lot of them - In __set_locale_from_locale_alias, use index '-1' instead of "ISO-8859-1" in call to lc_mbstowcs - In internal_setlocale, instead of __locale_charset(), compare __mbtowc and __charset_index with the corresponding cygheap values to see whether the charset has changed. Similar for ASCII test a bit further down - Copy __charset_index rather than __charset string to cygheap