a/src/internfile/mh_exec.cpp b/src/internfile/mh_exec.cpp
...
...
71
    m_havedoc = false;
71
    m_havedoc = false;
72
    if (missingHelper) {
72
    if (missingHelper) {
73
    LOGDEB(("MimeHandlerExec::next_document(): helper known missing\n"));
73
    LOGDEB(("MimeHandlerExec::next_document(): helper known missing\n"));
74
    return false;
74
    return false;
75
    }
75
    }
76
77
    int filtermaxseconds = 900;
78
    m_config->getConfParam("filtermaxseconds", &filtermaxseconds);
79
76
    if (params.empty()) {
80
    if (params.empty()) {
77
    // Hu ho
81
    // Hu ho
78
    LOGERR(("MimeHandlerExec::mkDoc: empty params\n"));
82
    LOGERR(("MimeHandlerExec::mkDoc: empty params\n"));
79
    m_reason = "RECFILTERROR BADCONFIG";
83
    m_reason = "RECFILTERROR BADCONFIG";
80
    return false;
84
    return false;
81
    }
85
    }
82
86
83
    int filtermaxseconds = 900;
84
    m_config->getConfParam("filtermaxseconds", &filtermaxseconds);
85
86
    // Command name
87
    // Command name
87
    string cmd = params.front();
88
    string cmd = params.front();
88
    
89
    
89
    // Build parameter vector: delete cmd name and add the file name
90
    // Build parameter vector: delete cmd name and add the file name
90
    vector<string>::iterator it = params.begin();
91
    vector<string>myparams(++it, params.end());
91
    vector<string>myparams(params.begin() + 1, params.end());
92
    myparams.push_back(m_fn);
92
    myparams.push_back(m_fn);
93
    if (!m_ipath.empty())
93
    if (!m_ipath.empty())
94
    myparams.push_back(m_ipath);
94
    myparams.push_back(m_ipath);
95
95
96
    // Execute command, store the output
96
    // Execute command, store the output
...
...
145
145
146
void MimeHandlerExec::finaldetails()
146
void MimeHandlerExec::finaldetails()
147
{
147
{
148
    m_metaData[cstr_dj_keyorigcharset] = m_dfltInputCharset;
148
    m_metaData[cstr_dj_keyorigcharset] = m_dfltInputCharset;
149
149
150
    // cfgFilterOutputCharset comes from the mimeconf filter definition line
150
    // cfgFilterOutputCharset comes from the mimeconf filter
151
    // definition line If the value is "default", we use the charset
152
    // value defined in recoll.conf (which may vary depending on
153
    // directory)
151
    string& charset = m_metaData[cstr_dj_keycharset];
154
    string& charset = m_metaData[cstr_dj_keycharset];
152
    charset = cfgFilterOutputCharset.empty() ? "UTF-8" : cfgFilterOutputCharset;
155
    charset = cfgFilterOutputCharset.empty() ? "UTF-8" : cfgFilterOutputCharset;
153
    if (!stringlowercmp("default", charset)) {
156
    if (!stringlowercmp("default", charset)) {
154
    charset = m_dfltInputCharset;
157
    charset = m_dfltInputCharset;
155
    }
158
    }
156
159
160
    // The output mime type is html except if defined otherwise in the filter
161
    // definition.
157
    string& mt = m_metaData[cstr_dj_keymt];
162
    string& mt = m_metaData[cstr_dj_keymt];
158
    mt = cfgFilterOutputMtype.empty() ? "text/html" : 
163
    mt = cfgFilterOutputMtype.empty() ? "text/html" : 
159
    cfgFilterOutputMtype;
164
    cfgFilterOutputMtype;
160
165
161
    // If this is text/plain transcode_to/check utf-8
166
    // If this is text/plain transcode_to/check utf-8