Fix i18n URL parsing problem in wxWebViewArchiveHandler
URL is encoded as UTF-8, so using c_str() may generate invalid encoded representation in non-UTF-8 locales. Closes https://github.com/wxWidgets/wxWidgets/pull/1022
This commit is contained in:
@@ -85,7 +85,7 @@ wxFSFile* wxWebViewArchiveHandler::GetFile(const wxString &uri)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
wxString fspath = "file:" +
|
wxString fspath = "file:" +
|
||||||
EscapeFileNameCharsInURL(path.substr(doubleslash + 2).c_str());
|
EscapeFileNameCharsInURL(path.substr(doubleslash + 2).utf8_str());
|
||||||
return m_fileSystem->OpenFile(fspath);
|
return m_fileSystem->OpenFile(fspath);
|
||||||
}
|
}
|
||||||
//Otherwise we need to extract the protocol
|
//Otherwise we need to extract the protocol
|
||||||
@@ -108,7 +108,7 @@ wxFSFile* wxWebViewArchiveHandler::GetFile(const wxString &uri)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
wxString fspath = "file:" +
|
wxString fspath = "file:" +
|
||||||
EscapeFileNameCharsInURL(mainpath.substr(doubleslash + 2).c_str())
|
EscapeFileNameCharsInURL(mainpath.substr(doubleslash + 2).utf8_str())
|
||||||
+ "#" + protocol +":" + archivepath;
|
+ "#" + protocol +":" + archivepath;
|
||||||
return m_fileSystem->OpenFile(fspath);
|
return m_fileSystem->OpenFile(fspath);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user