In
8b79c94af7f7cf2e5e5342294bc6e5a908cacabf changing to usage of C++ way
of setting the locale causes us to be terminated in case of usage of an
ungenerated locale as LC_ALL (or similar) – but we don't want to fail
here, we just want to carry on as before with setlocale which we call in
that case just for good measure.
void InitLocale(APT_CMD const binary) /*{{{*/
{
- std::locale::global(std::locale(""));
+ try {
+ std::locale::global(std::locale(""));
+ } catch (...) {
+ setlocale(LC_ALL, "");
+ }
switch(binary)
{
case APT_CMD::APT:
aptMethod(char const * const Binary, char const * const Ver, unsigned long const Flags) :
pkgAcqMethod(Ver, Flags), Binary(Binary)
{
- std::locale::global(std::locale(""));
+ try {
+ std::locale::global(std::locale(""));
+ } catch (...) {
+ setlocale(LC_ALL, "");
+ }
}
};
# but it also checks if the binary can find all methods in the library.
# The later is quite handy for manual testing of non-abibreaking changes
export LD_BIND_NOW=1
+# german variant of klingon used for testing usage of non-existent l10n
+export LC_ALL=tlh_DE.UTF-8
checkversionmessage() {
testsuccess grep '^apt .* (' ${1}-help.output