|
a/src/internfile/mh_text.cpp |
|
b/src/internfile/mh_text.cpp |
|
... |
|
... |
114 |
return false;
|
114 |
return false;
|
115 |
|
115 |
|
116 |
// We transcode even if defcharset is already utf-8:
|
116 |
// We transcode even if defcharset is already utf-8:
|
117 |
// this validates the encoding.
|
117 |
// this validates the encoding.
|
118 |
LOGDEB1(("MimeHandlerText::mkDoc: transcod from %s to utf-8\n",
|
118 |
LOGDEB1(("MimeHandlerText::mkDoc: transcod from %s to utf-8\n",
|
119 |
m_defcharset.c_str()));
|
119 |
m_dfltInputCharset.c_str()));
|
120 |
if (!transcode(m_text, m_metaData["content"], m_defcharset, "UTF-8")) {
|
120 |
if (!transcode(m_text, m_metaData["content"], m_dfltInputCharset, "UTF-8")) {
|
121 |
LOGERR(("MimeHandlerText::mkDoc: transcode to utf-8 failed "
|
121 |
LOGERR(("MimeHandlerText::mkDoc: transcode to utf-8 failed "
|
122 |
"for charset [%s]\n", m_defcharset.c_str()));
|
122 |
"for charset [%s]\n", m_dfltInputCharset.c_str()));
|
123 |
m_metaData["content"].erase();
|
123 |
m_metaData["content"].erase();
|
124 |
return false;
|
124 |
return false;
|
125 |
}
|
125 |
}
|
126 |
m_metaData["origcharset"] = m_defcharset;
|
126 |
m_metaData["origcharset"] = m_dfltInputCharset;
|
127 |
m_metaData["charset"] = "utf-8";
|
127 |
m_metaData["charset"] = "utf-8";
|
128 |
m_metaData["mimetype"] = "text/plain";
|
128 |
m_metaData["mimetype"] = "text/plain";
|
129 |
|
129 |
|
130 |
// If text length is 0 (the file is empty or oversize), or we have
|
130 |
// If text length is 0 (the file is empty or oversize), or we have
|
131 |
// read all at once, we're done
|
131 |
// read all at once, we're done
|