]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/m_layout.cpp
Avoid an assert in wxFrame::SetTitle
[wxWidgets.git] / src / html / m_layout.cpp
index 70302b7e91fe003dd06bfa8dfc2e4c87594caf14..1d3c5f675c42412d6335cb60943dc57fc47f4f2c 100644 (file)
@@ -4,7 +4,7 @@
 // Author:      Vaclav Slavik
 // RCS-ID:      $Id$
 // Copyright:   (c) 1999 Vaclav Slavik
-// Licence:     wxWidgets Licence
+// Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
 #pragma implementation
@@ -295,9 +295,15 @@ TAG_HANDLER_BEGIN(TITLE, "TITLE")
             wxHtmlWindow *wfr = (wxHtmlWindow*)(m_WParser->GetWindow());
             if (wfr)
             {
-                const wxString& src = *m_WParser->GetSource();
-                wfr->OnSetTitle(src.Mid(tag.GetBeginPos(), 
-                                        tag.GetEndPos1()-tag.GetBeginPos()));
+                wxString title = m_WParser->GetSource()->Mid(
+                                        tag.GetBeginPos(), 
+                                        tag.GetEndPos1()-tag.GetBeginPos());
+#if !wxUSE_UNICODE
+                wxCSConv conv(m_WParser->GetInputEncoding());
+                title = wxString(title.wc_str(conv), wxConvLocal);
+#endif
+                title = m_WParser->GetEntitiesParser()->Parse(title);
+                wfr->OnSetTitle(title);
             }
         }
         return TRUE;