]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/url.cpp
minor fix to find contents file alright
[wxWidgets.git] / src / common / url.cpp
index 3c8aebe2dc8cda5b303362112c888c0d84bd72e6..956f0266f471f3415fb97a0a32797a70e3a7c5e1 100644 (file)
@@ -208,7 +208,6 @@ bool wxURL::FetchProtocol()
 
       m_protoinfo = info;
       m_protocol = (wxProtocol *)m_protoinfo->m_cinfo->CreateObject();
-      wxSocketHandler::Master().Register(m_protocol);
       return TRUE;
     }
     info = info->next;
@@ -321,12 +320,16 @@ wxString wxURL::ConvertToValidURI(const wxString& uri)
   for (i=0;i<uri.Len();i++) {
     wxChar c = uri.GetChar(i);
 
-    if (!isalpha(c) && c != _T('.') && c != _T('+') && c != _T('.') && 
-                       c != _T('/')) {
-      hexa_code.Printf(_T("%02X"), c);
-      out_str += hexa_code;
-    } else
-      out_str += c;
+    if (c == _T(' '))
+      out_str += _T('+');
+    else {
+      if (!isalpha(c) && c != _T('.') && c != _T('+') && c != _T('.') && 
+                         c != _T('/')) {
+        hexa_code.Printf(_T("%%%02X"), c);
+        out_str += hexa_code;
+      } else
+        out_str += c;
+    }
   }
   
   return out_str;