/*
- * Copyright (c) [2019-2023] SUSE LLC
+ * Copyright (c) [2019-2024] SUSE LLC
*
* All Rights Reserved.
*
{
ParsedOpts::const_iterator it = opts.find("table-style");
if (it == opts.end())
- return TableFormatter::default_style;
+ return TableFormatter::default_style();
try
{
SN_THROW(OptionsException(error));
}
- return TableFormatter::default_style;
+ return TableFormatter::default_style();
}
/*
- * Copyright (c) [2019-2020] SUSE LLC
+ * Copyright (c) [2019-2024] SUSE LLC
*
* All Rights Reserved.
*
*/
+#include <cstring>
+#include <langinfo.h>
+
#include "client/utils/TableFormatter.h"
using namespace std;
- const TableStyle TableFormatter::default_style = Ascii;
+ TableStyle
+ TableFormatter::default_style()
+ {
+ return strcmp(nl_langinfo(CODESET), "UTF-8") == 0 ? TableStyle::Light : TableStyle::Ascii;
+ }
ostream&
/*
- * Copyright (c) [2019-2020] SUSE LLC
+ * Copyright (c) [2019-2024] SUSE LLC
*
* All Rights Reserved.
*
public:
- static const TableStyle default_style;
+ static TableStyle default_style();
TableFormatter(TableStyle style) : style(style) {}
+-------------------------------------------------------------------
+Fri Feb 16 08:26:41 CET 2024 - aschnell@suse.com
+
+- select table style based on codeset
+
-------------------------------------------------------------------
Wed Feb 14 09:14:32 CET 2024 - aschnell@suse.com