]> git.saurik.com Git - wxWidgets.git/blobdiff - src/html/helpdata.cpp
switching notebook implementation to common
[wxWidgets.git] / src / html / helpdata.cpp
index f67b1689c8886b8ba4b0dd82b4ce832635de23ff..e4ef62a1d5a264a9e3d09deca48d302b7e5b81ba 100644 (file)
@@ -475,11 +475,10 @@ void wxHtmlHelpData::SetTempDir(const wxString& path)
         m_tempPath = path;
     else
     {
-        if (wxIsAbsolutePath(path)) m_tempPath = path;
-        else m_tempPath = wxGetCwd() + wxT("/") + path;
+        wxFileName fn(path);
+        fn.MakeAbsolute();
 
-        if (m_tempPath[m_tempPath.length() - 1] != wxT('/'))
-            m_tempPath << wxT('/');
+        m_tempPath = fn.GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR);
     }
 }
 
@@ -686,6 +685,19 @@ bool wxHtmlHelpData::AddBook(const wxString& book)
         enc = wxFontMapper::Get()->CharsetToEncoding(charset);
 #endif
 
+    // No conversion was done on the title yet; at least
+    // test for a common case.
+    if (charset == wxT("utf-8") && !title.IsEmpty())
+    {
+        char *buf = new char[title.Length()+1];
+        size_t i;
+        for (i = 0; i < title.Length(); i++)
+            buf[i] = (char) title[i];
+        buf[i] = 0;
+        title = wxString::FromUTF8(buf);
+        delete[] buf;
+    }
+
     bool rtval = AddBookParam(*fi, enc,
                               title, contents, index, start, fsys.GetPath());
     delete fi;