winebrowser CP_UNIXCP support for "mailto:" URL

Tomasz Jezierski - Tefnet developers at tefnet.pl
Thu Apr 3 08:28:59 CDT 2008


---
 programs/winebrowser/main.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/programs/winebrowser/main.c b/programs/winebrowser/main.c
index ee7b947..e6c9a8b 100644
--- a/programs/winebrowser/main.c
+++ b/programs/winebrowser/main.c
@@ -347,8 +347,24 @@ int main(int argc, char *argv[])
         }
     }
 
-    if (!strncasecmp( url, "mailto:", 7 ))
-        ret = open_mailto_url( url );
+    if (!strncasecmp( url, "mailto:", 7 )) {
+        char *unixurl=NULL;
+        WCHAR *unixurlW=NULL;
+        int len;
+
+        len = MultiByteToWideChar( CP_ACP, 0, url, -1, NULL, 0 );
+        unixurlW = HeapAlloc(GetProcessHeap(), 0, len*sizeof(WCHAR));
+        MultiByteToWideChar( CP_ACP, 0, url, -1, unixurlW, len );
+
+        len = WideCharToMultiByte( CP_UNIXCP, 0, unixurlW, -1, NULL, 0, NULL,NULL );
+        unixurl = HeapAlloc(GetProcessHeap(), 0, len*sizeof(char));
+        WideCharToMultiByte( CP_UNIXCP, 0, unixurlW, -1, unixurl, len, NULL,NULL );
+
+        ret = open_mailto_url( unixurl );
+
+        HeapFree(GetProcessHeap(), 0, unixurlW);
+        HeapFree(GetProcessHeap(), 0, unixurl);
+    }
     else
         /* let the browser decide how to handle the given url */
         ret = open_http_url( url );
-- 
1.5.3.7


--=-X034vnOxHClSOMFOXc0y--




More information about the wine-patches mailing list