]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct conversion from text file to charset (which is read in that text file)
authorRobert Roebling <robert@roebling.de>
Fri, 23 Jan 2009 22:19:46 +0000 (22:19 +0000)
committerRobert Roebling <robert@roebling.de>
Fri, 23 Jan 2009 22:19:46 +0000 (22:19 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58343 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/html/htmlfilt.cpp

index 28c3de9e68acc0d0ac045b9515b26a5173dc6f2a..9aaa86d4ebadd4146ff018785f214fbadf66012c 100644 (file)
@@ -153,15 +153,19 @@ wxString wxHtmlFilterHTML::ReadFile(const wxFSFile& file) const
     }
     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