+ else
+ {
+ size_t size = s->GetSize();
+ wxCharBuffer buf( size );
+ s->Read( buf.data(), size );
+ wxString tmpdoc( buf, wxConvISO8859_1);
+
+ wxString charset = wxHtmlParser::ExtractCharsetInformation(tmpdoc);
+ if (charset.empty())
+ doc = tmpdoc;
+ else
+ {
+ wxCSConv conv(charset);
+ doc = wxString( buf, conv );
+ }
+ }
+#else // !wxUSE_UNICODE
+ ReadString(doc, s, wxConvLibc);
+ // add meta tag if we obtained this through http:
+ if (!file.GetMimeType().empty())
+ {
+ wxString hdr;
+ wxString mime = file.GetMimeType();
+ hdr.Printf(wxT("<meta http-equiv=\"Content-Type\" content=\"%s\">"), mime.c_str());
+ return hdr+doc;
+ }
+#endif