Fix wxURI::Unescape() to work with Unicode strings

Such strings are not really URIs as they should have been encoded if they were
but we can obtain them from e.g. wxFileSystem::FindFirst(), so handle them
correctly here as it's simpler than checking all the places where Unescape()
is called.

Add a unit test checking that decoding an URI containing both Unicode and
percent-encoded Unicode characters works correctly.
This commit is contained in:
Vadim Zeitlin
2016-02-13 03:59:43 +01:00
parent 0a555f3c83
commit 314630945a
4 changed files with 29 additions and 40 deletions

View File

@@ -137,11 +137,6 @@ protected:
static bool ParseIPv6address(const char*& uri);
static bool ParseIPvFuture(const char*& uri);
// should be called with i pointing to '%', returns the encoded character
// following it or -1 if invalid and advances i past it (so that it points
// to the last character consumed on return)
static int DecodeEscape(wxString::const_iterator& i);
// append next character pointer to by p to the string in an escaped form
// and advance p past it
//