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);
}
}
// Now store the contents range
bookr->SetContentsRange(cont_start, m_contents.size());
-#if wxUSE_WCHAR_T
// MS HTML Help files [written by MS HTML Help Workshop] are broken
// in that the data are iso-8859-1 (including HTML entities), but must
// be interpreted as being in language's windows charset. Correct the
}
#undef CORRECT_STR
}
-#else
- wxUnusedVar(IndexOld);
- wxUnusedVar(ContentsOld);
- wxASSERT_MSG(encoding == wxFONTENCODING_SYSTEM, wxT("Help files need charset conversion, but wxUSE_WCHAR_T is 0"));
-#endif // wxUSE_WCHAR_T/!wxUSE_WCHAR_T
m_bookRecords.Add(bookr);
if (!m_index.empty())
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;
break;
}
}
-
+
int cnt = m_bookRecords.GetCount();
-
+
if (!has_non_ascii)
{
wxFileSystem fsys;