]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/http.cpp
Use text/uri-list instead of x-moz-url in wxGTK wxURLDataObject.
[wxWidgets.git] / src / common / http.cpp
index 49f08f6dfb55e5702cc261a4ec06f376da5b1eae..f041115be962b2399dc08e69636c1043b72bd2b2 100644 (file)
@@ -218,12 +218,20 @@ wxHTTP::SetPostText(const wxString& contentType,
                     const wxString& data,
                     const wxMBConv& conv)
 {
+#if wxUSE_UNICODE
     wxScopedCharBuffer scb = data.mb_str(conv);
-    if ( !scb.length() )
+    const size_t len = scb.length();
+    const char* const buf = scb.data();
+#else // !wxUSE_UNICODE
+    const size_t len = data.length();
+    const char* const buf = data.mb_str(conv);
+#endif // wxUSE_UNICODE/!wxUSE_UNICODE
+
+    if ( !len )
         return false;
 
     m_postBuffer.Clear();
-    m_postBuffer.AppendData(scb.data(), scb.length());
+    m_postBuffer.AppendData(buf, len);
     m_contentType = contentType;
 
     return true;