From 2a96b61d31cc51611731297f936a477663871b9d Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Fri, 9 Feb 2018 11:52:53 +0100 Subject: Fail correctly on charset conversion error --- src/MuxElements.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/MuxElements.cpp b/src/MuxElements.cpp index a31791a..24c81b3 100644 --- a/src/MuxElements.cpp +++ b/src/MuxElements.cpp @@ -179,7 +179,7 @@ int DabLabel::setLabel(const std::string& label) m_flag = 0xFF00; // truncate the label to the eight first characters try { - m_label = charset_converter.convert(label); + m_label = charset_converter.convert(label, false); } catch (const utf8::exception& e) { etiLog.level(warn) << "Failed to convert label '" << label << @@ -196,9 +196,10 @@ int DabLabel::setLabel(const std::string& label, const std::string& short_label) newlabel.m_flag = 0xFF00; try { - newlabel.m_label = charset_converter.convert(label); + newlabel.m_label = charset_converter.convert(label, false); - int flag = newlabel.setShortLabel(charset_converter.convert(short_label)); + int flag = newlabel.setShortLabel( + charset_converter.convert(short_label, false)); if (flag < 0) { return flag; } -- cgit v1.2.3