--- a/src/internfile/mh_execm.cpp
+++ b/src/internfile/mh_execm.cpp
@@ -25,7 +25,6 @@
#include "debuglog.h"
#include "cancelcheck.h"
#include "smallut.h"
-#include "transcode.h"
#include "md5.h"
#include "rclconfig.h"
#include "mimetype.h"
@@ -283,39 +282,21 @@
}
// Charset. For many document types it doesn't matter. For text
- // and html it does. We supply a default from the
- // configuration.
- bool trustcharset = true;
+ // and html it does. We supply a default from the configuration.
if (charset.empty()) {
charset = cfgFilterOutputCharset.empty() ? "utf-8" :
cfgFilterOutputCharset;
if (!stringlowercmp("default", charset)) {
- trustcharset = false;
charset = m_dfltInputCharset;
}
}
-
- string& output = m_metaData[cstr_content];
- if (!m_metaData[cstr_mimetype].compare(cstr_textplain) &&
- (!trustcharset || stringlowercmp("utf-8", charset))) {
- string transcoded;
- int ecnt;
- if (!transcode(output, transcoded, charset, "UTF-8", &ecnt)) {
- LOGERR(("mh_execm: transcode failed from [%s] to UTF-8\n",
- charset.c_str()));
- // Erase text in this case: it's garbage
- output.clear();
- } else {
- if (ecnt) {
- LOGDEB(("mh_exec: %d transcoding errors from [%s] to UTF-8\n",
- ecnt, charset.c_str()));
- }
- output = transcoded;
- charset = "utf-8";
- }
+ m_metaData[cstr_origcharset] = charset;
+ m_metaData[cstr_charset] = charset;
+
+ if (!m_metaData[cstr_mimetype].compare(cstr_textplain)) {
+ (void)txtdcode("mh_execm");
}
- m_metaData[cstr_charset] = charset;
if (eofnext_received)
m_havedoc = false;