From e4102b4374e3acde31c9d320166ef37855834c72 Mon Sep 17 00:00:00 2001 From: Vincent Richard Date: Mon, 15 Oct 2012 11:19:53 +0200 Subject: [PATCH] Do not fail if charset is not recognized. --- src/word.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/word.cpp b/src/word.cpp index 2876ddfb..1ea22931 100644 --- a/src/word.cpp +++ b/src/word.cpp @@ -695,7 +695,16 @@ const string word::getConvertedText(const charset& dest) const { string out; - charset::convert(m_buffer, out, m_charset, dest); + try + { + charset::convert(m_buffer, out, m_charset, dest); + } + catch (vmime::exceptions::charset_conv_error& e) + { + // Do not fail if charset is not recognized: + // copy 'word' as raw text + out = m_buffer; + } return (out); }