# # patch "ChangeLog" # from [1989d47b96862cf9c79fd28f4b9b013b94cec334] # to [29e68be8bd50d2c8fb9ca2967c561f77078359ba] # # patch "monotone.cc" # from [b14c80b029c2e415ac088c5375a4fd9f079579d3] # to [c03090ecc52ded9911f34cb3ea2049abf83bd6f7] # # patch "transforms.cc" # from [8d8fc2f4a1ea1d8f9c27470b71d171255a9c6f20] # to [6d5f7cbd27b7951744515f8d619ab2c6f640f3bc] # # patch "transforms.hh" # from [6fe1d145188c2c348e519926c5f3a999f237abda] # to [7e826327f16187c5ad1c1c0f8a61be241c85fb34] # ======================================================================== --- ChangeLog 1989d47b96862cf9c79fd28f4b9b013b94cec334 +++ ChangeLog 29e68be8bd50d2c8fb9ca2967c561f77078359ba @@ -1,5 +1,11 @@ 2005-08-23 Nathaniel Smith + * transforms.{cc,hh} (system_charset): Expose. + * monotone.cc (cpp_main): Use it to fiddle with gettext's charset + conversion and make --help output actually correct. + +2005-08-23 Nathaniel Smith + * transforms.cc (outprep): Don't sanitize all output; removes too many valid characters (\r, \t, etc.). * ui.cc: Call outprep on ticker output. ======================================================================== --- monotone.cc b14c80b029c2e415ac088c5375a4fd9f079579d3 +++ monotone.cc c03090ecc52ded9911f34cb3ea2049abf83bd6f7 @@ -238,8 +238,7 @@ setlocale(LC_ALL, ""); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); - const char * default_textdomain_codeset - = bind_textdomain_codeset(PACKAGE, "UTF-8"); + bind_textdomain_codeset(PACKAGE, "UTF-8"); // we want to catch any early informative_failures due to charset // conversion etc @@ -530,8 +529,8 @@ } // switch gettext() back to returning native charset strings, since popt - // will simply dump whatever gettext() returns - bind_textdomain_codeset(PACKAGE, default_textdomain_codeset); + // will simply dump whatever gettext() returns. + bind_textdomain_codeset(PACKAGE, system_charset().c_str()); poptPrintHelp(ctx(), stdout, 0); bind_textdomain_codeset(PACKAGE, "UTF-8"); ======================================================================== --- transforms.cc 8d8fc2f4a1ea1d8f9c27470b71d171255a9c6f20 +++ transforms.cc 6d5f7cbd27b7951744515f8d619ab2c6f640f3bc @@ -502,7 +502,7 @@ // general character code conversion routines -static string +string system_charset() { char const * locale_charset_name = stringprep_locale_charset (); ======================================================================== --- transforms.hh 6fe1d145188c2c348e519926c5f3a999f237abda +++ transforms.hh 7e826327f16187c5ad1c1c0f8a61be241c85fb34 @@ -174,6 +174,7 @@ // charset conversions void charset_convert(std::string const & src_charset, std::string const & dst_charset, std::string const & src, std::string & dst); +std::string system_charset(); void system_to_utf8(external const & system, utf8 & utf); void utf8_to_system(utf8 const & utf, external & system); void ace_to_utf8(ace const & ac, utf8 & utf);