X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ec2c85bf79778212bfcbc849e0a69c1c59bafc90..0b97da9986eaa64afb1289748c642d083077b58a:/src/html/helpdata.cpp diff --git a/src/html/helpdata.cpp b/src/html/helpdata.cpp index edebdcc7fb..e4ef62a1d5 100644 --- a/src/html/helpdata.cpp +++ b/src/html/helpdata.cpp @@ -685,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;