// tag if we used Content-Type header).
#if wxUSE_UNICODE
int charsetPos;
- if ((charsetPos = file.GetMimeType().Find(_T("; charset="))) != wxNOT_FOUND)
+ if ((charsetPos = file.GetMimeType().Find(wxT("; charset="))) != wxNOT_FOUND)
{
wxString charset = file.GetMimeType().Mid(charsetPos + 10);
wxCSConv conv(charset);
}
else
{
- wxString tmpdoc;
- ReadString(tmpdoc, s, wxConvISO8859_1);
+ size_t size = s->GetSize();
+ wxCharBuffer buf( size+1 );
+ s->Read( buf.data(), size );
+ *(buf.data() + size) = 0;
+ wxString tmpdoc( buf, wxConvISO8859_1);
+
wxString charset = wxHtmlParser::ExtractCharsetInformation(tmpdoc);
if (charset.empty())
doc = tmpdoc;
else
{
wxCSConv conv(charset);
- doc = wxString(tmpdoc.mb_str(wxConvISO8859_1), conv);
+ doc = wxString( buf, conv );
}
}
#else // !wxUSE_UNICODE
{
wxString hdr;
wxString mime = file.GetMimeType();
- hdr.Printf(_T("<meta http-equiv=\"Content-Type\" content=\"%s\">"), mime.c_str());
+ hdr.Printf(wxT("<meta http-equiv=\"Content-Type\" content=\"%s\">"), mime.c_str());
return hdr+doc;
}
#endif